Pagini recente » Borderou de evaluare (job #1677678) | Monitorul de evaluare | Diferente pentru problema/seti intre reviziile 5 si 4 | Borderou de evaluare (job #532100) | Cod sursa (job #1107055)
#include <fstream>
using namespace std;
int P, nrz = 1, N = 1;
int zero(int k){
long m = 5;
int z = 0;
while(k/m != 0){
z+=k/m;
m*=5;
}
return z;
}
int searchN(){
while(nrz != P){
nrz = zero(N);
N++;
}
return N;
}
int main()
{
ifstream f("fact.in");
ofstream g("fact.out");
f>>P;
g<<searchN() - 1;
return 0;
}