Cod sursa(job #707996)

Utilizator buclucashuMihai Moldovan buclucashu Data 6 martie 2012 10:33:36
Problema Factorial Scor 10
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.23 kb
#include<fstream>
using namespace std;
int main()
{
	ifstream f("fact.in");
	int n,i,s=1;
	f>>n;
	f.close();
	for(i=2;n;i++)
	{
		s*=i;
		if(s%10==0)
		{
			s/=10;
			n--;
		}
	}
	ofstream g("fact.out");
	g<<i-1;
}