Cod sursa(job #815236)
| Utilizator | Data | 16 noiembrie 2012 18:46:50 | |
|---|---|---|---|
| Problema | Cifra | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.34 kb |
#include <fstream>
#include <math.h>
using namespace std;
ifstream f("cifra.in");
ofstream g("cifra.out");
int main()
{
unsigned int T,uc;
long long S=0,N=0;
f>>T;
while (N!=T)
{
N++;
S=S+pow(N,N);
uc=S%10;
g<<uc<<'\n';}
f.close();
g.close();
return 0;
}
