Cod sursa(job #3216004)
Utilizator | Data | 15 martie 2024 15:47:32 | |
---|---|---|---|
Problema | Cifra | Scor | 0 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.3 kb |
#include <iostream>
#include <fstream>
#include <cmath>
using namespace std;
ifstream f("cifra.in");
ofstream h("cifra.out");
int main() {
int n, s, t;
f >> t;
for (int j = 1; j <= t; j++) {
f >> n;
s = 0;
for (int i = 1; i <= n; i++)
s += pow(i, i);
h << s % 10 << endl;
}
}