Cod sursa(job #2936358)
Utilizator | Data | 8 noiembrie 2022 18:30:16 | |
---|---|---|---|
Problema | Factorial | Scor | 15 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.3 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream fin ("fact.in");
ofstream fout ("fact.out");
int main()
{
long long n=0,s=-1,p,x;
fin>>x;
while (s!=x)
{
n++;
p=5;
s=0;
while(p<=n){
s+=n/p;
p*=5;}
}
fout<<n;
return 0;
}