Cod sursa(job #3282040)
Utilizator | Data | 4 martie 2025 12:49:12 | |
---|---|---|---|
Problema | Factorial | Scor | 0 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.54 kb |
#include <iostream>
#include <fstream>
using namespace std;
ifstream in("fact.in");
ofstream out("fact.out");
int main()
{
int n,p=0;
cin>>n;
int ind=0;
if(!n){
cout<<1;
}
else {
while(n>p){
int q=ind;
while(q){
if(q%5==0){
q/=5;
p++;
}
else{
q=0;
}
}
ind+=5;
}
cout<<ind-5;
}
return 0;
}