Cod sursa(job #2442606)
Utilizator | Data | 24 iulie 2019 15:40:53 | |
---|---|---|---|
Problema | Cifra | Scor | 0 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.34 kb |
#include<fstream>
#include<cmath>
using namespace std;
ifstream f ("cifra.in");
ofstream g ("cifra.out");
int t,v[30001];
long long n,s,i,j;
int main()
{
f>>t;
for(i=1;i<=t;i++)
f>>v[i];
for(i=1;i<=t;i++)
{s=0;
for(j=1;j<=v[i];j++)
s = s + pow(j,j);
g<<s%10<<endl;}
}