HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Sections > Linear Data Structures: Arrays > problem:


51107 - Factorial

Guest
• Review clarifications (1)

Section problems

• 50448 - Paint Buckets
• 50925 - Optimizing Elevator Usage
• 50269 - Matrix Determinant
• 50988 - Laplacian Filter
• 50986 - The Oldest Person
• 51173 Question 5
• 50873 - Max Frequency
• 51009 - Sum of the nth row
• 51107 - Factorial
• ECE - Question 1
• CEN - Question 1
• Reflektimi i pikes
• 50972 - Division
• 51135 - Class Average 1
• 51136 - Class Average 2
• 51094 - Passing the course
• Question 1

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