Cod sursa(job #1641655)
Utilizator | Data | 9 martie 2016 09:27:39 | |
---|---|---|---|
Problema | Cifra | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.4 kb |
#include <iostream>
#include <fstream>
#include <math.h>
using namespace std;
ifstream f("cifra.in");
ofstream g("cifra.out");
int a,n,i,j;
long long int aux=1;
int main()
{
f>>n;
for (i=1;i<=n;i++)
{
f>>a;
for (j=2;j<=a;j++)
{
aux=aux+pow(j,j);
}
aux=aux%10;
g<<aux<<endl;
aux=1;
}
return 0;
}