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