Cod sursa(job #1119807)

Utilizator NarTooNNever Roll NarTooN Data 24 februarie 2014 20:11:34
Problema Cifra Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.34 kb
//http://www.infoarena.ro/problema/cifra
#include<iostream>
#include <math.h>
#include <fstream>
using namespace std;
int n,t,s=0,i;
int main()
{
    ifstream f("cifra.in");
    ofstream g("cifra.out");
    f>>t;
    int v[t];
    for(i=1;i<=t;i++)
    {
    f>>v[i];
    s=s+pow(v[i],v[i]);
    g<<s%10<<endl;
    }
    return 0;
}