Cod sursa(job #1126564)
| Utilizator | Data | 27 februarie 2014 02:12:03 | |
|---|---|---|---|
| Problema | Jocul Flip | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.34 kb |
#include <iostream>
#include <fstream>
#include <string>
#include <math.h>
using namespace std;
int main()
{
ifstream f("cifra.in");
ofstream g("cifra.out");
string aux;
long int n,s;
int nr;
f>>aux;
n = stol(aux);
for (long int i=0;i<n;i++) {
f>>aux;
nr = stol(aux);
s+=pow(nr,nr); g<<s%10;}
f.close();
g.close();
return 0;
}
