Pagini recente » Monitorul de evaluare | Monitorul de evaluare | Cod sursa (job #1789775) | Cod sursa (job #267473) | Cod sursa (job #602842)
Cod sursa(job #602842)
#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;
}