Cod sursa(job #547242)

Utilizator GaborGabrielFMI - GabrielG GaborGabriel Data 6 martie 2011 01:15:44
Problema Factorial Scor 10
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.27 kb
#include <fstream.h>
ifstream f("fact.in");
ofstream g("fact.out");
long long n,m,t=0;

int main()
{
	f>>n;	
	if(n==0)
		g<<1<<'\n';
	else
	{
		m=n;
		while(m/10!=0)
			t++,m/=10;		
		t=t*5;					
		g<<5*n-t<<'\n';
	}
	f.close();
	g.close();
	return 0;
}