Cod sursa(job #3319445)
| Utilizator | Data | 1 noiembrie 2025 13:32:57 | |
|---|---|---|---|
| Problema | Factorial | Scor | 0 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva de probleme | Marime | 0.39 kb |
#include <iostream>
#include <fstream>
using namespace std;
ifstream fin("fact.in");
ofstream fout("fact.out");
int main()
{
int n, p, i;
fin>>p;
while(p>0)
{
int j=i;
while(j%5==0)
{
j=j/5;
p--;
}
i++;
}
if(p<0)
{
fout<<"-1";
}
else fout<<--i;
return 0;
}
