Pagini recente » Cod sursa (job #172685) | Profil florinhaja | Cod sursa (job #1342668) | Diferente pentru preoni-2006/runda-4/solutii intre reviziile 9 si 27 | Cod sursa (job #163349)
Cod sursa(job #163349)
#include<fstream>
using namespace std;
long fact(long x){
if(x == 1) return 1;
else return x * fact(x - 1);
}
int nr(long x){
int ret = 0;
while(x % 10 == 0){
ret++;
x /= 10;
}
return ret;
}
int main(){
fstream in("fact.in", ios::in), out("fact.out", ios::out);
long p, i;
in >> p;
for(i = p * 3;;i++){
if(nr(fact(i)) == p) break;
}
out << i;
}