//百思不得其解为什么我的错了
//虽然他的取余数比我的高明,但是我还是没看懂公式,啊啊啊!
//(foot+inch/12)×0.3048
#include<stdio.h>
int main(){
printf("please input a cm: \n");
int cm = 0;
scanf("%d",&cm);
double m = cm / 100.0;
double foot = m / (1 + 1 / 144) / 0.3048;
double inch = (foot - (int)foot) * 12;
printf("%d %d", (int)foot, (int)inch);
return 0;
}
//0 sample, inch 尾数大于0.5,不是四舍五入而是截断
//1 0
//2 feet为0
//3 inch为0,尾数小于0.5
//而这个却对了
#include<stdio.h>
int main()
{
int cm=0,inch=0,foot=0;
scanf("%d",&cm);
inch=cm/(30.48/12);
foot=inch/12;
inch=inch%12;
printf("%d %d",foot,inch);
return 0;
}