Cod sursa(job #222874)
Utilizator | Data | 25 noiembrie 2008 20:27:57 | |
---|---|---|---|
Problema | Cifra | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.29 kb |
#include <fstream.h>
#include <math.h>
int main ()
{ int a,b,s,p;
ifstream in ("cifra.in");
ofstream out ("cifra.out");
in>>a;
s=0;
for(b=1;b<=a;b++)
{ s=s+pow(b,b);
p=s%10;
out<<p<<"\n";
}
in.close ();
out.close ();
return 0;
}