Cod sursa(job #2544943)
Utilizator | Data | 12 februarie 2020 18:19:36 | |
---|---|---|---|
Problema | Cifra | Scor | 0 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.4 kb |
#include <iostream>
#include <fstream>
#include <math.h>
using namespace std;
ifstream fin("cifra.in");
ofstream fout("cifra.out");
int main()
{
long long n,t,s;
fin>>t;
for(int i=1;i<=t;i++)
{
fin>>n;
s=0;
for(int j=1;j<=n;j++)
s=s+pow(j,j);
fout<<s%10<<endl;
}
fin.close();
fout.close();
return 0;
}