Cod sursa(job #1536265)
Utilizator | Data | 25 noiembrie 2015 21:41:29 | |
---|---|---|---|
Problema | Cifra | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.43 kb |
#include <fstream>
#include <cmath>
using namespace std;
int p,t,l,i,j,T;
long long x;
ifstream f("cifra.in");
ofstream g("cifra.out");
void cifre(long long a)
{
long long S=0; long long L=0;
int l=a%40;
for(int i=1;i<=l;i++)
L+=pow(i,i);
S=(a/40)*7+L;
int z=S%10;
g<<z<<endl;
}
int main()
{
f>>T;
for(int i=1;i<=T;i++)
{f>>x;
cifre(x);
}
return 0;
}