Cod sursa(job #323901)
Utilizator | Data | 14 iunie 2009 01:02:29 | |
---|---|---|---|
Problema | Cifra | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.28 kb |
#include <stdio.h>
#include <math.h>
unsigned long long p,s,i;
int t;
int main ()
{
freopen ("cifra.in","r",stdin);
freopen ("cifra.out","w",stdout);
scanf ("%lld", &t);
for (i=1;i<=t;i++)
{
p=pow(i,i);
s+=p;
printf ("%lld\n", s%10);
}
return 0;
}