Cod sursa(job #999427)
| Utilizator | Data | 20 septembrie 2013 13:33:58 | |
|---|---|---|---|
| Problema | Cifra | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.38 kb |
#include <iostream>
#include <fstream>
#include <math.h>
using namespace std;
int main()
{
ifstream in("cifra.in");
ofstream out("cifra.out");
double t,n,i,s,j;
int a;
in >> t;
for (i=1;i<=t;i++)
{
s=0;
in >> n;
for (j=1;j<=n;j++)
s=s+pow(j,j);
a=s;
out << a%10 << "\n";
}
}
