Cod sursa(job #233717)
Utilizator | Data | 18 decembrie 2008 23:27:55 | |
---|---|---|---|
Problema | Cifra | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.27 kb |
#include <fstream>
#include<math.h>
using namespace std;
ifstream f("cifra.in");
ofstream g("cifra.out");
int main()
{ unsigned int x,s=0,p;
f>>x;
while(f>>x)
{ p=pow(x,x);
s=s%10+p%10;
g<<s%10<<"\n";
}
f.close();
g.close();
return 0;
}