Cod sursa(job #2087778)
Utilizator | Data | 14 decembrie 2017 11:19:37 | |
---|---|---|---|
Problema | Factorial | Scor | 5 |
Compilator | cpp | Status | done |
Runda | bon | Marime | 0.4 kb |
#include <stdio.h>
#include <fstream>
#include <iostream>
using namespace std;
ifstream fin("fact.in");
ofstream fout("fact.out");
int main()
{
int qwe=0,zxc;
unsigned a;
fin>>a;
if ((a%6)==(5%6)){
fout<<-1;
}
else{
zxc=a*5;
while (zxc/25!=0){
qwe+=1;
zxc/=25;
}
fout<<(a-qwe)*5;
}
return 0;
}