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