Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб.
Factorial
Question:
Here's a challenge that's a bit more mathematical in nature. Write a program that determines the number of trailing zeros at the end of X! (X factorial), where X is an arbitrary number. For instance, 5! is 120, so it has one trailing zero. (How can you handle extremely values, such as 100!?)
Input specification:
You will be given one integer (X) where
1 ≤ X ≤ 30,000.
Output specification:
Show the number of trailing zeros at the end of X!.
Sample Inputs |
Sample Outputs |
100
1000
100000
300000
400000
|
24
249
24999
74998
99999
|
Для отправки решений необходимо выполнить вход.
|