Cod sursa(job #28472)
Utilizator | Data | 7 martie 2007 21:12:00 | |
---|---|---|---|
Problema | Cifra | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.37 kb |
#include<stdio.h>
#include<math.h>
long t,n,i,j;
int main()
{
freopen("cifra.in","r",stdin);
freopen("cifra.out","w",stdout)
scanf("%ld",&t);
for(i=0;i<t;i++){
s=0;
x=0;
n=0;
scanf("%ld",&n);
for(j=1;j<=n;j++)s=s+pow(j,j);
printf("%ld\n",s%10);
}
fcose;
return 0;
}