Cod sursa(job #1316973)
Utilizator | Data | 14 ianuarie 2015 13:38:45 | |
---|---|---|---|
Problema | Cifra | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.45 kb |
#include <iostream>
#include <fstream>
#include <math.h>
using namespace std;
int main()
{
ifstream f("cifra.in");
ofstream g("cifra.out");
int t,i ;
f >> t ;
int v[t+1] ;
for (i=1;i<=t;i++) f >> v[i] ;
long long suma = 0 ;
for (i=1;i<=t;i++)
{
suma += pow(v[i],v[i]);
suma = suma % 10 ;
}
g<<suma;
f.close();
g.close();
return 0;
}