Cod sursa(job #120823)
Utilizator | Data | 6 ianuarie 2008 18:59:21 | |
---|---|---|---|
Problema | Cifra | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.45 kb |
#include <fstream.h>
#include <math.h>
int main() {
ifstream f("cifra.in");
register int n, i = 1, y;
unsigned long int t, aux = 0;
ofstream fout("cifra.out");
f>>n;
while (i <= n) {
f>>t;
for (y = 1; y <= i; y++) {
aux += pow(y, y);
}
fout<<aux%10<<'\n';
i++;
aux = 0;
}
f.close();
fout.close();
return 0;
}