### Woburn Challenge 1995

## Problem 5: Factorial Power

The factorial of a whole number N (written "N!") is defined as follows: N! = 1 * 2 * 3 * ... * (N-1) * N

For example, 10! = 1 x 2 x 3 x 4 x 5 x 6 x 7 x 8 x 9 x 10 = 3628800.

The "factorial length" of a number N is defined as the number of digits in N!.
Thus the factorial length of 10 is 7.

### Input

On each of five lines is a positive integer N in the range 1..500.### Output

For each of the five inputs, output that number's factorial length in the format shown below.### Sample Input

1 2 5 10 52

### Sample Output

The length of 1! is 1 The length of 2! is 1 The length of 5! is 3 The length of 10! is 7 The length of 52! is 68

All Submissions

Best Solutions

**Point Value:** 5

**Time Limit:** 2.00s

**Memory Limit:** 16M

**Added:** Sep 29, 2008

**Languages Allowed:**

C++03, PAS, C, ASM, C#, C++11

## Comments (Search)

Hzhangon Jul 14, 2014 - 2:05:50 am UTC Stringwgma00on Jul 14, 2014 - 12:48:59 pm UTC Re: Stringdipon Oct 31, 2013 - 11:53:10 pm UTC HelpWhat am I doing wrong...

bbi5291on Nov 01, 2013 - 5:41:55 am UTC Re: Helpdipon Nov 01, 2013 - 7:13:36 pm UTC Re: Helpjargonon Nov 01, 2013 - 8:06:55 pm UTC Re: HelpEven a "long long int" only holds just over 18 digits. You won't be able to solve this by simply calculating the factorial.

purohit3105on Dec 14, 2008 - 11:05:34 pm UTC length fuction?thanks.

PS I tried to look for ir but it didn't help..:(

taimla101on Dec 14, 2008 - 11:14:29 pm UTC Re: length fuction?qinhaotianon Dec 15, 2008 - 12:03:15 am UTC Re: length fuction?SourSpinachon Dec 15, 2008 - 12:08:22 am UTC Re: length fuction?However, even the biggest type of integer in C++ can only store about 18 digits, while 52! has 68, so you'll need to think of another way.