Cod sursa(job #2452578)
Utilizator | Data | 31 august 2019 12:59:41 | |
---|---|---|---|
Problema | Cifra | Scor | 0 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.49 kb |
#include <iostream>
#include <fstream>
#include <math.h>
using namespace std;
int main()
{
ifstream fin ("cifra.in");
ofstream fout ("cifra.out");
int t,i,j,cif=0;
fin>>t;
int v[t];
for(i=0;i<t;i++)
{
fin>>v[i];
}
for(i=0;i<t;i++)
{
for(j=1;j<=v[i];j++)
{
cif = cif + pow(j,j);
}
fout<<cif%10<<endl;
cif=0;
}
fin.close();
fout.close();
return 0;
}