Pagini recente » Cod sursa (job #463626) | Cod sursa (job #3312943) | Cod sursa (job #640125) | Cod sursa (job #324044) | Cod sursa (job #602840)
Cod sursa(job #602840)
#include<stdio.h>
int fac(int n) {
if ( n == 0 )
return 1;
else return n*fac(n-1);
}
int main(){
int n=0,p,i;
FILE *in,*out;
in = fopen("fact.in","r");
fscanf(in,"%d",p);
int temp=0;
int temp1=0;
while ( temp < p) {
n++;
temp1= n;
while ( temp1%5==0) {
temp++;
temp1=temp1/5;
}
i=n;
}
fclose(in);
out = fopen("fact.out","w");
fprintf(out,"%d",i);
fclose(out);
return 0;
}