Cod sursa(job #414592)
Utilizator | Data | 10 martie 2010 11:54:55 | |
---|---|---|---|
Problema | Factorial | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.25 kb |
#include <stdio.h>
int n,p,x,nr,y;
int main() {
FILE *f=fopen("fact.in","r");
FILE *g=fopen("fact.out","w");
fscanf(f,"%d",&p);
x=1;
while(nr<p) {
x++;
y=x;
while(y%5==0) {
nr++;
y=y/5;
}
}
fprintf(g,"%d",&x);
return 0;
}