Cod sursa(job #140446)
Utilizator | Data | 21 februarie 2008 21:07:50 | |
---|---|---|---|
Problema | Cifra | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.31 kb |
#include<stdio.h>
#include<math.h>
int main () {
long int n,t,s,x;
freopen("cifra.in","r",stdin);
freopen("cifra.out","w",stdout);
scanf("%ld",&t);
s=0;
for (n=1;n<=t;n++){
scanf("%ld",&x);
s=s+pow(x,x);
if(s>9) printf("%ld",s&10);
else
printf("%ld",s);}
return 0;
}