ГлавнаяСборникиТурнирыРазделыФорумыУчастникиПечатьПомощьО системе

Сборники > Фёдор Меньшиков. Тренировки > задача:


153. 50368 - Right-most non zero digit in N!

Гость
• Обсуждение задачи (2)

Задачи сборника

• 136. 50443 - Dajte Express
• 140. 50655 - Plotpjesetueshmeria me 9
• 145. 50656 - Plotpjestueshmeria me 11
• 147. 50553 - I pjestueshem me 2013
• 148. 50596 - Udhetimi juaj eshte ketu
• 148. 50596 - Udhetimi juaj eshte ketu
• 150. 50763 - Valid Password
• 151. 50560 - Distanca maksimale
• 153. 50368 - Right-most non ze...
• 155. 50379 - a^b modulus k
• 158. 50404 - Sum of Self Powers
• 160. Cmimi Mesatar i Karburantit
• 180. 50343 - The number of Ending...
• 30. 50764 - Fast Typing Competition

Обратная связь

Если у вас есть предложения или пожелания по работе Contester, посетите форум сайта www.contester.ru.

Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб.
Prepared by Ibrahim Mesecan.

The right-most non zero digit in N!

Question:
Write a program which shows the right-most non-zero digit in N! where N is a positive integer less than 32000. For example:

  • 5!=120 ==> right-most non zero digit is 2
  • 7!=5040 ==> right-most non zero digit is 4
  • 10!=368800 ==> right-most non zero digit is 8

Input specification
You are given an integer (N) where is 1 ≤ N ≤ 32,000.

Output specification
Show right most non-zero digit in N!

 Sample Input I     Sample Input II   
 345
 1000
 Sample Output I     Sample Output II   
 8
 2


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

www.contester.ru