Cod sursa(job #656605)

Utilizator Black_TigerSima Cristian Black_Tiger Data 4 ianuarie 2012 21:00:41
Problema Factorial Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.43 kb
#include<iostream>
#include<fstream>

using namespace std;

std::ifstream f("adunare.in");
std::ofstream g("adunare.out");
int main(void){
	
	
	long int	x=1,i=2,p,j;
	f>>p;
	if(p==0)
		g<<1;
	else
	{
		
		
	bool go=true;
	while(go)
	{ 
		
		//imultim
		x=x*i;
		j=0;
		int x2=x;
		while(x2%10 == 0)
		{
			j++;
			x2=x2/10;
		}
	
		if(j==p)
			go=false;
	    else
			i++;
		
	}
g<<i;
	
	}
return 0;
}