Cod sursa(job #1624085)
Utilizator | Data | 2 martie 2016 00:08:55 | |
---|---|---|---|
Problema | Cifra | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.32 kb |
#include <iostream>
#include <fstream>
#include <vector>
#include <math.h>
using namespace std;
int main()
{
int n,a,s,p;
ifstream f ("cifra.in");
ofstream g ("cifra.out");
vector<int> x;
f>>n;
for(int i=0; i<n; i++)
{
f>>a;
s+=pow(a,a);
g<<s%10;
}
}