Cod sursa(job #679592)

Utilizator DevilShadowJunc Raul Cosmin DevilShadow Data 13 februarie 2012 15:32:02
Problema Factorial Scor 25
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.29 kb
#include <fstream>
using namespace std;

int i = 1, o, p;

int main()
{
	long count = 0;
	ifstream f ("fact.in");
	ofstream g ("fact.out");
	
	f >> p;
	
	while(1)
	{
		o = i;
		while(o % 5 == 0)
		{
			o /= 5;
			count ++;
		}
		if(count == p)
			break;
		i ++;
	}
	g << i;
}