Cod sursa(job #185559)

Utilizator codrinCodrin LACHE codrin Data 25 aprilie 2008 17:38:25
Problema Factorial Scor 45
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.25 kb
#include<fstream.h>

int main()
{
 ifstream fin("fact.in");
 ofstream fout("fact.out");
 int s=0,p,k=0,aux;
 fin>>p;
	while(k<p)
		{
		 s+=5;
		 aux=s;
			while(aux%5==0)
				{
				 aux/=5;
				 k++;
				 }
		}
fout<<s;
return 0;
}