Cod sursa(job #1132224)
Utilizator | Data | 2 martie 2014 21:37:02 | |
---|---|---|---|
Problema | Cifra | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.33 kb |
#include <iostream>
#include <fstream>
#include <math.h>
using namespace std;
int main() {
fstream f("cifra.in", ios::in);
fstream g("cifra.out", ios::out);
int t; unsigned long long int n;
while (f>>n) {
int suma;
for (unsigned long long int i; i<=n; i++) {
suma += pow(i, i);
}
g << suma%10;
}
return 0;
}