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 |
Для отправки решений необходимо выполнить вход.
|