Cod sursa(job #2658057)
Utilizator | Data | 13 octombrie 2020 08:37:59 | |
---|---|---|---|
Problema | Factorial | Scor | 25 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.37 kb |
#include <iostream>
#include<fstream>
using namespace std;
ifstream fin("fact.in");
ofstream fout("fact.out");
int P,N,ok=0,M,nr2=0,nr5=0;
int main()
{
fin>>P;
N=0;
while(ok==0)
{
N++; M=N;
while(M%5==0)
{
M=M/5;
nr5++;
}
if( nr5>=P)
ok=1;
}
fout<<N;
return 0;
}