Cod sursa(job #2023715)

Utilizator Andrei.GheorgheAndrei Gheorghe Andrei.Gheorghe Data 19 septembrie 2017 13:37:23
Problema Cifra Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.41 kb
#include<fstream>
#include<math.h>
#include<algorithm>
using namespace std;
int main()
{
    int n,v[100],i,j,x,s=0;
    ifstream cin("cifra.in");
    ofstream cout("cifra.out");
    cin>>n;
    for(i=0;i<n;i++)
    {
        cin>>v[i];
    }
    for(j=1;j<=n;j++)
    {
        for(x=1;x<=v[j-1];x++)
        {
            s=s+pow(x,x);
        }
        cout<<s%10<<endl;
        s=0;
    }
}