HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Beginners > problem:


025. 50294 - Centimeters to Yards

Guest
• Discussion of problem (2)

Volume problems

• 50292 - Average of 4 Marks
• 001. 51153 - A+B.
• 002. 50348 - Area and Perimeter of ...
• 003. 50349 - Area of a Triangle
• 004. 50350 - Fahrenheit to Celsius
• 010. 50357 - Convert Euros into Dol...
• 015. 50356 - Hours Passed
• 020. 50351 - Convert inches to cm
• 025. 50294 - Centimeters to Yards
• 030. 50341 - Separate Into Digits
• 040. 50879 - Passed or Failed
• 040. Problem 1
• 055. 50355 - Bills of City Water Co...
• 060. 50583 - Max of 3 numbers
• 065. 50436 - Pocket Money
• 070. 50439 - Telephone Calls
• 080. 50478 - Letter Grades

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. Difficulty Alpha

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