Cod sursa(job #541235)
| Utilizator | Data | 24 februarie 2011 22:04:39 | |
|---|---|---|---|
| Problema | Factorial | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.6 kb |
#include <iostream>
using namespace std;
inline unsigned long long int find_five(long p) {
long i=0,zero=0,j;
short cont;
while(p>0) {
cont=1;
i+=5;
j=i/5;
verifica:
if(j%5==0) {
cont++;
j/=5;
goto verifica;
}
p-=cont;
zero+=cont;
}
return i;
}
int main() {
long p;
// ifstream f("fact.in");
cin>>p;
// f.close();
// ofstream g("fact.out");
cout<<find_five(p);
// g.close();
return 0;
}
