Cod sursa(job #220841)

Utilizator b0by_ceausuCeausu Bogdan Constantin b0by_ceausu Data 13 noiembrie 2008 08:36:54
Problema Factorial Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.32 kb
#include <fstream.h>
ifstream f("fact.in");
ofstream g("fact.out");
long n,i,nr,p,gasit;
void main ()
{
f>>p;
for  (n=p;n>=1;n--)
   {  nr=0;
     for (i=1;i<=n;i++)
	 while (i%5==0)
	       nr++;
     if (nr==p)
      {	gasit++;
	break;
	}  }
if (gasit>0)
   g<<n;
   else
   g<<'1';
f.close ();
g.close ();
}