Cod sursa(job #1143521)
Utilizator | Data | 15 martie 2014 17:24:37 | |
---|---|---|---|
Problema | Cifra | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.3 kb |
#include <iostream>
#include <fstream>
#include <math.h>
using namespace std;
int main()
{
int n, i, s = 0;
ifstream f("cifra.in");
ofstream g("cifra.out");
f >> n;
for (i = 1; i <= n; i++)
{
s = s + pow ( i, i);
g << s % 10;
g << endl;
}
system("pause");
return 0;
}