SP2124 FCTRL4 - Last Non-Zero Digit of Factorials
Description
Tom is fascinated by big numbers. Most of all he likes factorials. First, he computed **N!** for some small values of **N**. But factorials were getting longer and longer very quickly and each of them had a long sequence of zeroes at its end. Since he was unable to consider so many digits in his research and he thought that the research on zeroes would be boring, he decided to focus on the last non-zero digit of factorials.
For example 4!=24 so the last non-zero digit is 4. For **N**=5 we have 5!=120 and the last non-zero digit 2.
Tom needs to know the last non-zero digit of **N!** for several specific values of **N**. Help him please.
Input Format
N/A
Output Format
N/A