#include<stdio.h>
int main()
{
printf("请分别输入身高的英尺和英寸," "如输入\"5 7\"表示5英尺7英寸:\n");
int foot;
double inch;
scanf("%d %lf",&foot,&inch);
printf("身高是%f米。\n",((foot+inch/12)*0.3048));
return 0;
}
//注意:在两个数做运算时,只要有一个是浮点数,计算的结果均为浮点数!
#include<stdio.h>
int main()
{
printf("请分别输入身高的英尺和英寸," "如输入\"5 7\"表示5英尺7英寸:\n");
int foot;
double inch;
scanf("%d %lf",&foot,&inch);
printf("身高是%f米。\n",((foot+inch/12)*0.3048));
return 0;
}
//注意:在两个数做运算时,只要有一个是浮点数,计算的结果均为浮点数!