Cod sursa(job #59972)

Utilizator DjSefuWrong name DjSefu Data 11 mai 2007 16:47:26
Problema Factorial Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.32 kb
#include<stdio.h>
FILE *f=fopen("fact.in","r"),
     *g=fopen("fact.out","w");
int sum(long long x){
{ int s=0;
  while(x%5==0) x/=5,++s;++s;
  return s;
}
long long p,n,i,j,s,k;
int main()
{ fscanf(f,"%lld",&p);
  while(s!=p)s+=sum(++i);
  fprintf(g,"%lld\n",&i*5);
  fclose(f);
  fclose(g);
  return 0;
}