Cod sursa(job #27990)
| Utilizator | Data | 7 martie 2007 13:12:46 | |
|---|---|---|---|
| Problema | Cifra | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.25 kb |
#include "fstream.h"
#include "math.h"
ifstream f("cifra.in");
ofstream g("cifra.out");
int main()
{ 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,N);
g<<s%10;
}
return 0;
}
