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