厘米换算英尺英寸

 1 /*
 2     QQ:778138708
 3     2020年5月6日
 4     厘米换算英尺英寸
 5     思路:将输入的厘米数换成浮点数形式的英尺,然后求整数形式的英尺和英寸
 6  */
 7 #include <stdio.h>
 8 int main(void)
 9 {
10     int centimeter;
11     int foot, inch;
12     double t;
13     
14     scanf("%d", &centimeter);
15     t = centimeter / 100.0 / 0.3048;
16     foot=(int)t;
17     inch = (int)((t - foot) * 12);
18     
19     printf("%d %d
", foot, inch);
20     
21     return 0;
22 }
原文地址:https://www.cnblogs.com/2018jason/p/12834504.html