Cod sursa(job #2657494)
Utilizator | Data | 10 octombrie 2020 19:56:14 | |
---|---|---|---|
Problema | Factorial | Scor | 20 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.47 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%2==0)
{
M=M/2;
nr2++;
}
M=N;
while(M%5==0)
{
M=M/5;
nr5++;
}
if(nr2>=P && nr5>=P)
ok=1;
}
fout<<N;
return 0;
}