Cod sursa(job #296788)
Utilizator | Data | 5 aprilie 2009 09:42:01 | |
---|---|---|---|
Problema | Cifra | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.24 kb |
#include <fstream.h>
#include <math.h>
void main()
{
int n,t,i,s,j;
ifstream a("cifra.in");
ofstream b("cifra.out");
a>>t;
for(i=1;i<=t;i++)
{
a>>n;
s=0;
for(j=1;j<=n;j++)
s+=pow(j,j);
b<<s%10<<" ";
}
}