为什么程序运算结果不对
问题描述:
#include <stdio.h>
int main()
{
printf("请输入身高:()英尺/()英寸"
"比如\"5、7\"代表5英尺7英寸");
int foot = 0;
int inch = 0;
scanf("%d %d",&foot,&inch);
printf("身高为%d米\n",
((foot + inch / 12) * 0.3048));
return 0;
}
答
foot + inch 改成foot * 1.0 + inch * 1.0