Cod sursa(job #528150)

Utilizator Theorytheo .c Theory Data 2 februarie 2011 11:24:19
Problema Factorial Scor 15
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.28 kb
#include<fstream.h>
int i=1,j,k=5,p,s=0,l=0;
int main(){
	ifstream fin("fact.in");
	fin>>p;
	fin.close();
	ofstream fout("fact.out");
	while(l<p)
	{   l=0;
	    k=5;
		i++;
		while(i/k)
		{
			l=l+i/k;
			k=k*5;
		}
		
	}
	fout<<i;
	
	fout.close();
	return 0;
}