Pagini recente » Cod sursa (job #797219) | Cod sursa (job #314652) | Cod sursa (job #1707888) | Cod sursa (job #2978813) | Cod sursa (job #2642496)
#include<iostream>
#include<fstream>
using namespace std;
ifstream fin("fact.in");
ofstream fout("fact.out");
int main() {
int fact=1,nr=1,p,zero,nr_zero=0,fact_cont;
fin >> p;
while (nr_zero!=p) {
nr++;
fact *= nr;
fact_cont = fact;
nr_zero = 0;
do {
zero = fact_cont % 10;
fact_cont /= 10;
nr_zero++;
} while (zero==0);
nr_zero--;
}
fout << nr;
cin.get();
return 0;
}