Cod sursa(job #362585)

Utilizator beyond_k7aOnutu Catalin beyond_k7a Data 10 noiembrie 2009 09:34:38
Problema Factorial Scor 20
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.3 kb
#include<iostream>
#include<fstream>
using namespace std;
int main()
{
	ifstream f("fact.in");
	ofstream g("fact.out");
	
	int p,i,t=0,x;
	f>>p;
	for(i=1;t<p;i++)
	{
		x=i;
		while(x%5==0)
		{
			t++;
			x/=5;
		}
	}
	g<<i-1<<"\n";
	
	
	
	
	
	f.close();
	g.close();
	return 0;
}