Cod sursa(job #2365709)

Utilizator MichaelXcXCiuciulete Mihai MichaelXcX Data 4 martie 2019 15:56:47
Problema Cifra Scor 0
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.62 kb
#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;
}