Pagini recente » Cod sursa (job #700250) | Cod sursa (job #623688) | Cod sursa (job #568903) | Cod sursa (job #577610) | Cod sursa (job #1416491)
#include <stdio.h>
int main(){
FILE *fin, *fout;
fin=fopen("fact.in", "r");
fout=fopen("fact.out", "w");
int n, p, prod, gasit, j, i, pp;
fscanf(fin, "%d", &p);
if(p==0)
j=1;
else{
i=1;
gasit=0;
while(gasit==0){
j++;
i=1;
while(i<j){
prod=prod*i;
i++;
}
pp=0;
while(prod%10==0){
pp++;
prod=prod/10;
}
if(pp=p)
gasit=1;
}
}
fprintf(fout, "%d", j);
fclose(fin);
fclose(fout);
return 0;
}