Mai intai trebuie sa te autentifici.
Cod sursa(job #2577206)
Utilizator | Data | 8 martie 2020 17:48:27 | |
---|---|---|---|
Problema | Cifra | Scor | 0 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.58 kb |
#include <bits/stdc++.h>
#include <math.h>
#include <fstream>
using namespace std;
ifstream fin("cifra.in");
ofstream fout("cifra.out");
typedef long long int lint;
int v[150000];
int main()
{
int n;
fin>>n;
for(int i = 1; i <= n; i++)
{
fin>>v[i];
}
for(int i = 1; i <= n; i++)
{
int sum = 0;
for(int j = 1; j <= v[i]; j++)
{
int poww = pow(j, j);
sum += poww;
}
fout<<sum%10;
cout<<endl;
}
fin.close();
fout.close();
return 0;
}