Cod sursa(job #368891)

Utilizator crysysdeaconu ioan crysys Data 26 noiembrie 2009 13:11:26
Problema Factorial Scor 10
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.46 kb
#include<fstream.h>
int main()   
{   
ifstream f("fact.in");   
ofstream g("fact.out");   
 long long p,n,j,b;
 f>>p;
 int gasit=0;
 n=0;
 b=0;
/* if(p==0)
  g<<"1";
  else
 while(gasit==0)
 {
   n=n+5;
    j=n;
    while(j%5==0 && j!=0)
    {
     j=j/5;
     b++;
    }
    if(b==p)
      {
        gasit=1;
	 g<<n;
     }
     else
      if(b>p)
      {
       gasit=1;
	g<<"-1";
       }
  }          */
  g<<"-1";
 return 0;
}