Cod sursa(job #890767)
Utilizator | Data | 25 februarie 2013 11:46:34 | |
---|---|---|---|
Problema | Cifra | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.38 kb |
#include <fstream>
#include <math.h>
using namespace std;
ifstream f("cifra.in");
ofstream g("cifra.out");
int n,sum,x,i,j;
int main()
{
f>>n;
for(i=1;i<=n;i++)
{
f>>x;
sum=0;
for(j=1;j<=x;j++)
{
sum=sum+pow(j,j);
}
g<<sum%10<<" ";
}
g<<'\n';
f.close();g.close();
return 0;
}