Cod sursa(job #633933)

Utilizator mihai_stanusoiuStanusoiu Mihai Teodor mihai_stanusoiu Data 15 noiembrie 2011 09:26:49
Problema Factorial Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.33 kb
#include<iostream>
#include<fstream>
using namespace std;
ifstream f("fact.in");
ofstream g("fact.out");
int main()
{
	long P,N,x,y,gasit,a;
	
	
	f>>P;
	f.close();
	x=0; y=0;
	N=1;
	gasit=0;
	while(gasit==0)
	{
		a=N;
		while(a%5==0)
		{
			y++;
			a=a/5;
		}
		if (y==P) gasit=1;
	}
	cout<<N<<'\n';
	return 0;	
}