Cod sursa(job #944825)
| Utilizator | Data | 29 aprilie 2013 20:02:39 | |
|---|---|---|---|
| Problema | Cifra | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.29 kb |
#include<iostream>
#include<fstream>
#include<math.h>
using namespace std;
int main()
{int t,n,i,j,s;
ifstream f("cifra.in");
ofstream g("cifra.out");
f>>t;
for(i=1;i<=t;i++)
{s=0;
for(j=1;j<=i;j++)
s=s+pow(j,j);
cout<<s%10<<endl;
}
f.close();
g.close();
}
