Cod sursa(job #2368514)

Utilizator MichaelXcXCiuciulete Mihai MichaelXcX Data 5 martie 2019 16:26:17
Problema Cifra Scor 0
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.64 kb
#include    <iostream>
#include    <fstream>
#include    <cmath>
#include    <complex>
#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 Sum(LL x)
{
    LL j = 1;
    while(j <= x)
    {
        s += pow(j, j);
        lastDig(s);
        fout << lastDig(s) << "\n";
        j++;
    }
}

int main()
{
    read();
    Sum(T);
    return 0;
}