Cod sursa(job #35415)
| Utilizator | Data | 22 martie 2007 00:55:52 | |
|---|---|---|---|
| Problema | Cifra | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.35 kb |
#include<fstream.h>
#include<math.h>
#include<iostream.h>
#include<conio.h>
int main(){
ifstream fin("cifra.in");
ofstream fout("cifra.out");
int t,x;
fin>>t;
for(int i=1;i<=t;i++)
{fin>>x;
int j=1;
double k=0;
while(j<=x)
{k=(k+pow(j,j)+10)%10;
j++;
}
fout<<k<<"\n";
}
return 0;
fin.close();
fout.close();
getch();
}