WC '95 P5 - Factorial Power

View as PDF

Submit solution

Points: 5
Time limit: 1.0s
Memory limit: 16M

Problem types
Allowed languages
ALGOL 68, Assembly, Brain****, C, C++, COBOL, Forth, Fortran, Java, Lua, Text, Turing
Woburn Challenge 1995

The factorial of a whole number N (written as N!) is defined as follows:

\displaystyle N! = 1 \times 2 \times \dots \times (N-1) \times N

For example, 10! = 1 \times 2 \times 3 \times 4 \times 5 \times 6 \times 7 \times 8 \times 9 \times 10 = 3\,628\,800.
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 Specification

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

Output Specification

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

Comments

There are no comments at the moment.