Cod sursa(job #23658)

Utilizator gaby06Harja Gabriel gaby06 Data 1 martie 2007 09:52:08
Problema Factorial Scor 60
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.3 kb
#include<fstream.h>

ifstream fin("fact.in");
ofstream fout("fact.out");

unsigned long int i ,j, p, f;


int main()
{
  fin >> p;

  for(i = 1 ; f < p; i ++)
  {
	f++;
	j=i;
	while(j % 5 == 0)
	{
	 f++;
	 j/=5;
	}
  }

 fout<<(i-1)*5;



 fin.close();
 fout.close();
 return 0;
}