Cod sursa(job #2395723)
Utilizator | Data | 2 aprilie 2019 20:17:48 | |
---|---|---|---|
Problema | Factorial | Scor | 0 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.32 kb |
#include <iostream>
#include <cmath>
using namespace std;
long long t,n,s,j,p;
int main()
{
cin>>t;
for(int i=1;i<=t;i++)
{
cin>>n;
for(j=1;j<=n;j++)
{
p=pow(j,j);
s=s+p;
}
cout<<s%10<<endl;
s=0;
}
return 0;
}