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

Разделы > Ad-Hoc > задача:


50294 - Centimeters to Yards

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

Задачи раздела

• 50253 - Timer
• 50294 - Centimeters to Yards
• 50298 - Coins
• 50303 - Pattern
• 50882 - FizzBuzz
• 50322 - Snake Pattern
• 50302 - Paper Scissors Rock
• 50312 - Sales Bar Chart
• 50313 - Pattern Displays
• 50375 - Area of Circles

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

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

Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб. Сложность Альфа

Centimeters to Yards

Write a program that converts centimeters to yards feet and inches.

  • One Yard is 3 feet
  • One Feet is 12 inches
  • One Inch is 2.54 centimeters

Write a program that inputs a length expressed in centimeters. The program should then convert the length to inches (to the nearest inch down) and output the length expressed in yards, feet, and inches. For example, suppose the input for centimeters is 348 (round down to the nearest inch). That is equal to 137 inches: There are 3 full yards in 137 (3x36=108). After that you have 29 inches (137-(3x36)==>29) left. There are 2 feet in 29 inches (29 - (2x12)==>5) Thus the output would be:
    3 yards, 2 feet, and 5 inches.

Input specification
You will be given a floating point number (cm) where 0 ≤ cm ≤ 50000, find how many full yards, feet and inches does it make?

Output specification
Show three integers (Yards, feet and inches).

Sample Input I
  348
Sample Input II
  87
Sample Output I
  3 2 5
Sample Output II
  0 2 10


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

www.contester.ru