Cod sursa(job #3030140)
Utilizator | Data | 17 martie 2023 15:34:04 | |
---|---|---|---|
Problema | Factorial | Scor | 60 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.37 kb |
#include <fstream>
using namespace std;
ifstream fin("fact.in");
ofstream fout("fact.out");
int main()
{
long long p, j = 0, x5=0, aux, k = 0;
fin >> p;
while(x5 < p)
{
k = 0;
j += 5;
aux = j;
while(aux % 5 == 0)
{
aux /= 5;
k++;
}
x5 += k;
}
fout << j;
return 0;
}