Cod sursa(job #27995)
Utilizator | Data | 7 martie 2007 13:17:54 | |
---|---|---|---|
Problema | Cifra | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.27 kb |
#include "fstream.h"
#include "math.h"
ifstream f("cifra.in");
ofstream g("cifra.out");
int main()
{ clrscr();
int p,N,s=0;
f>>p;
for (int i=0; i<p; i++)
{s=0;
f>>N;
for (int j=1;j<=N;j++)
s=s+pow(j,j);
g<<s%10;
}
return 0;
}