Pagini recente » Diferente pentru problema/oneouts intre reviziile 2 si 10 | Cod sursa (job #1656383) | Diferente pentru problema/drum-bugetat intre reviziile 10 si 9 | Cod sursa (job #2519184) | Cod sursa (job #1536265)
#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;
}