Cod sursa(job #3174212)
Utilizator | Data | 24 noiembrie 2023 13:33:02 | |
---|---|---|---|
Problema | Cifra | Scor | 0 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.3 kb |
#include <iostream>
#include <fstream>
#include <cmath>
std::ifstream f("cifra.in");
std::ofstream g("cifra.out");
int main()
{
int n, m;
f >> n;
while(f>>m)
{
int rez = 0;
for (int j = 1; j <= m; j++)
{
rez = rez + pow(j,j);
}
g << rez%10 <<std::endl;
}
return 0;
}