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:

N!=1×2××(N1)×N

For example, 10!=1×2×3×4×5×6×7×8×9×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 Specification

On each of five lines is a positive integer N in the range 1500.

Output Specification

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

Sample Input

Copy
1
2
5
10
52

Sample Output

Copy
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.