Cod sursa(job #184142)
Utilizator | Data | 23 aprilie 2008 10:02:51 | |
---|---|---|---|
Problema | Cifra | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.63 kb |
#include<fstream>
#include<stdio.h>
#include<math.h>
using namespace std;
ifstream fin ("cifra.in");
int main ()
{
freopen("cifra.out","w",stdout);
int i,n,k,k1,s;
s=0;
fin>>n;
for(i=1;i<=n;i++)
{
fin>>k;
if(k>10)
k1=k%10;
else
k1=k;
s=s+pow(k1,k1);
s%=10;
// printf("%d ",k);
printf("%d",s);
printf("\n");
}
return 0;
}