Cod sursa(job #1808740)
Utilizator | Data | 18 noiembrie 2016 00:56:14 | |
---|---|---|---|
Problema | Cifra | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.46 kb |
#include<iostream>
#include<fstream>
using namespace std;
ifstream f("cifra.in");
ofstream g("cifra.out");
int main()
{
int s=0, t, q;
f>>t;
while(t!=0)
{
int x = 1;
f>>q;
int z = q;
while (z!=0)
{
x *= q;
--z;
}
s += x;
g<<s%10<<endl;
t--;
}
return 0;
}