Cod sursa(job #2987642)
Utilizator | Data | 2 martie 2023 17:32:46 | |
---|---|---|---|
Problema | Factorial | Scor | 30 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.46 kb |
#include <fstream>
using namespace std;
ifstream in ("fact.in");
ofstream out ("fact.out");
int main()
{
long long p,q,cnt=0,i;
in>>p;
if(cnt==p)
{
out<<1;
return 0;
}
for(i=1;i<=10000000;i++)
{
q=5*i;
while(q%5==0)
{
q=q/5;
cnt++;
}
if(cnt>=p)
{
out<<i*5;
return 0;
}
}
return 0;
}