Cod sursa(job #1714061)

Utilizator pacheprotopopescuPake Protopopescu pacheprotopopescu Data 7 iunie 2016 12:08:03
Problema Cifra Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.37 kb
#include <fstream>
#include <cmath>
using namespace std;

int main()
{
    ifstream f("cifra.in");
    ofstream g("cifra.out");
    int t,v[100],j,i;
    long int s;
    f>>t;
    for(i=1;i<=t;i++)
        f>>v[i];
    for(i=1;i<=t;i++)
    {
        s=0;
        for(j=1;j<=v[i];j++)
            s=s+pow(j,j);
        s=s%10;
        g<<s<<endl;
    }
}