Cod sursa(job #972590)

Utilizator octavsOctav S. octavs Data 12 iulie 2013 11:04:43
Problema Factorial Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.24 kb
#include <fstream>
using namespace std;

int main()
{
long long p;
int zeros=0,i,j;
ifstream fin("fact.in");
ofstream fout("fact.out");
fin>>p;
for(i=0;zeros<=p;i=i+5)
{
j=i;
while(j%5==0 && j!=0)
	{
		zeros++;
		j=j/5;
	}
}

fout<<i;
return 0;
}