Cod sursa(job #596329)
Utilizator | Data | 16 iunie 2011 21:26:47 | |
---|---|---|---|
Problema | Cifra | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.27 kb |
#include<iostream.h>
#include<fstream.h>
#include<math.h>
int main()
{
ifstream c("cifra.in");
ofstream v("cifra.out");
int t,i,n,u,s=0;
c>>t;
for(i=1;i<=t;i++)
{
c>>n;
s=s+pow(n,n);
u=s%10;
v<<u;
v<<endl;
}
c.close();
v.close();
system("pause");
return 0;
}