Cod sursa(job #1511357)
Utilizator | Data | 26 octombrie 2015 17:49:44 | |
---|---|---|---|
Problema | Cifra | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.53 kb |
#include <iostream>
#include <fstream>
using namespace std;
int x,s,i,j,y,b;
int main()
{
long int a;
ifstream f("cifra.in");
ofstream g("cifra.out");
f>>a;
x=1;
for(i=1;i<=a;i++)
{
f>>b;
for(j=1;j<=b;j++)
{
for(y=1;y<=j;y++)
{
x=x%10;
x=x*j;
}
s=s+x%10;
x=1;
}
g<<s%10<<endl;
s=0;
}
f.close();
g.close();
return 0;
}