Cod sursa(job #176482)
Utilizator | Data | 11 aprilie 2008 12:27:47 | |
---|---|---|---|
Problema | Cifra | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.39 kb |
#include<fstream>
#include<math.h>
using namespace std;
ifstream fin ("cifra.in");
ofstream fout ("cifra.out");
int main ()
{
long long n,i,k,s,g;
fin>>n;
long long unsigned x;
s=0;
for(i=1;i<=n;i++)
{
fin>>g;
x=pow(g,g);
s=s%10+x%10;
fout<<s%10<<endl;
x=0;
}
return 0;
}