Cod sursa(job #1502605)

Utilizator cristiancCristian cristianc Data 14 octombrie 2015 20:42:38
Problema Factorial Scor 25
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.25 kb
#include <fstream>
using namespace std;
int main()
{
	ifstream ii("fact.in");
	ofstream oo("fact.out");
	long i = 0, p, j;  ii >> p;
	do
	{
		i += 5;  j = i;
		while (j%5 == 0)
		{
			j /= 5;  p--;
		}
	}
	while (p > 0);
	oo << i;
}