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

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


50294 - Centimeters to Yards

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

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

• 50512 - Coding redundancy
• 50528 - Rock-Scissors-Paper
• 50493 - n-digit kth Prime Number
• 50520 - Filling a Matrix Randomly
• 50454 - What day is it?
• 50474 - Sum of Two Primes
• 50597 - Vizatojme Diamante
• 50253 - Timer
• 50294 - Centimeters to Yards
• 50303 - Pattern
• 50882 - FizzBuzz
• 50322 - Snake Pattern
• 50302 - Paper Scissors Rock
• 50396 - Cinema Tickets - 1
• 50366 - Student Averages (2 Grades)
• 50357 - Convert Euros into Dollars
• 50466 - Drawing Square From Stars

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

Если у вас есть предложения или пожелания по работе 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