#include
int main()
{
doule Father;
double Mother;
double Me;
printf("请输入父亲的身高\n");
scanf("%f",&Father);
printf("请输入妈妈的身高\n");
scanf("%f",&Mother);
Me=(Father+Mother)*0.54;
printf("预测孩子的身高是%f\n",Me);
return 0;
}
double 类型使用%lf
#include <stdio.h>
int main()
{
double Father;
double Mother;
double Me;
printf("请输入父亲的身高\n");
scanf("%lf",&Father);
printf("请输入妈妈的身高\n");
scanf("%lf",&Mother);
Me=(Father+Mother)*0.54;
printf("预测孩子的身高是%lf\n",Me);
return 0;
}
不知道你这个问题是否已经解决, 如果还没有解决的话: