Cod sursa(job #1132820)

Utilizator axl013alex alex axl013 Data 3 martie 2014 22:32:03
Problema Factorial Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.42 kb
#include<iostream>
#include<fstream>
using namespace std;
int numara(int x)
{
	int l = 0;
	while (x % 10 == 0)
		l++;
	return l;
}
int main()
{
    	int p,  i;
		long fct = 1;
	ifstream f("fact.in");
	ofstream g("fact.out");
	f >> p;
	if (p == 0)
		g << 1;
	else
	for (i = 1; i <= 32000; i++)
	{

		fct = fct*i;
		if (numara(fct) == p)
			g << i;
		break;
	}
	
	
	system("pause");
	return 0;
}