Cod sursa(job #791455)
Utilizator | Data | 24 septembrie 2012 11:45:20 | |
---|---|---|---|
Problema | Cifra | Scor | 0 |
Compilator | cpp | Status | done |
Runda | asem-info | Marime | 0.4 kb |
#include <stdio.h>
#include <math.h>
int main(){
int a,c,d;
int b=1;
int e=0;
int i=0;
freopen("cifra.in", "r", stdin);
freopen("cifra.out", "w", stdout);
scanf ("%d",&a);
while (i<a){
d=pow(b,b);
c=d+e;
e=c;
b=b+1;
i=i+1;
}
c=c%10;
printf ("%d \n",c);
return 0;
}