Cod sursa(job #1867281)
Utilizator | Data | 3 februarie 2017 22:09:04 | |
---|---|---|---|
Problema | Cifra | Scor | 0 |
Compilator | c | Status | done |
Runda | Arhiva de probleme | Marime | 0.39 kb |
#include<stdio.h>
int main(){
char c;
char t;
freopen("cifra.in","r", stdin);
freopen("cifra.out","w", stdout);
scanf("%c", &t);
int i;
int j;
j = t - '0';
int n = 0;
int x, w, p;
for(i = 1; i <= j; i++){
scanf(" %c", &c);
x = c - '0';
p = x;
w = 1;
while(x > 0){
w = w * p;
x--;
}
n = n + w;
printf("%d\n", n % 10);
}
return 0;
}