Cod sursa(job #30658)
Utilizator | Data | 14 martie 2007 20:23:04 | |
---|---|---|---|
Problema | Cifra | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.29 kb |
#include<fstream.h>
#include<math.h>
int main() {
ifstream f("cifra.in");
ofstream g("cifra.out");
int t,i,j,s[100],S,k=0;
double n,x;
f>>t;
for(i=1;i<=t;i++)
{f>>n;S=0;
for(j=1;j<=n;j++)
{x=pow(j%10,j%10);
S+=(int)x%10;}
g<<s[k]<<'\n';
}
f.close();
g.close();
return 0;
}