Cod sursa(job #23644)

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

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

int f, ok;
unsigned long int i ,j, p;


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;
}