Cod sursa(job #31437)
Utilizator | Data | 16 martie 2007 00:00:31 | |
---|---|---|---|
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();
short t,i,j,b=0;
long double n;
ifstream in("cifra.in");
ofstream out("cifra.out");
in>>t;
for (i=1;i<=t;i++)
{
b=0;
in>>n;
for(j=1;j<=n;j++) b=b+pow(j,j);
out<<b%10<<endl;
}
// getch();
in.close();
out.close();
}