HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Sections > Linear Data Structures: Arrays > problem:


51107 - Factorial

Guest
• Review clarifications (1)

Section problems

• 50986 - The Oldest Person
• 50925 - Optimizing Elevator Usage
• 51173 Question 5
• 50334 - What is the class average?
• 50873 - Max Frequency
• 51009 - Sum of the nth row
• ECE - Question 1
• CEN - Question 1
• 51107 - Factorial
• Reflektimi i pikes
• 50972 - Division
• Question 1
• 51135 - Class Average 1
• 51136 - Class Average 2
• 51094 - Passing the course
• 51130 - Permutation of Everything
• 51069 - Last Digit of a Fibonacci Nu...

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.

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



Для отправки решений необходимо выполнить вход.

www.contester.ru