Cod sursa(job #31421)
Utilizator | Data | 15 martie 2007 23:24:22 | |
---|---|---|---|
Problema | Cifra | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.36 kb |
#include<iostream.h>
#include<fstream.h>
//#include<conio.h>
#include<math.h>
int main()
{
// clrscr();
int t,a[30000],i,j;
int b=0;
ifstream in("cifra.in");
ofstream out("cifra.out");
in>>t;
for (i=1;i<=t;i++)
{
in>>a[i];
for(j=1;j<=a[i];j++) b=b+pow(j,j);
out<<b%10<<endl;
b=0;
}
// getch();
in.close();
out.close();
}