Cod sursa(job #1244992)
Utilizator | Data | 18 octombrie 2014 15:06:30 | |
---|---|---|---|
Problema | Factorial | Scor | 0 |
Compilator | c | Status | done |
Runda | Arhiva de probleme | Marime | 0.31 kb |
#include <stdio.h>
int main() {
long x=1,ot=0,p,y,k=0;
FILE *f;
f=fopen("factorial.in","r");
fscanf(f,"%ld",&p);
fclose(f);
while (k!=p) {
x++; y=x;
while (y%5==0) { k++; y=y/5; }
}
f=fopen("factorial.out","w");
fprintf(f,"%ld",x);
fclose(f);
return 0;
}