Pagini recente » Cod sursa (job #175374) | Cod sursa (job #2676041) | Cod sursa (job #1604423) | Cod sursa (job #1442750) | Cod sursa (job #2365709)
#include <iostream>
#include <fstream>
#include <cmath>
#define LL long long
#define MAX 10000000000000
using namespace std;
ifstream fin("cifra.in");
ofstream fout("cifra.out");
LL T, s;
char v[MAX];
void read()
{
fin >> T;
for(int i = 1; i <= T; i++)
{
fin >> v[i];
}
}
int lastDig(LL n)
{
int c;
c = n % 10;
return c;
}
void power(LL x)
{
LL j = 1;
while(j <= x)
{
s += pow(j, j);
lastDig(s);
fout << lastDig(s) << "\n";
j++;
}
}
int main()
{
read();
power(T);
return 0;
}