哈哈哈946 2022-10-07 16:36 采纳率: 66.7%
浏览 13
已结题

没报错可是运行出错了

#include <stdio.h>
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; 

}

  • 写回答

2条回答 默认 最新

  • 心寒丶 优质创作者: 编程框架技术领域 2022-10-07 17:08
    关注

    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; 
    }
    
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论 编辑记录
查看更多回答(1条)

报告相同问题?

问题事件

  • 系统已结题 10月15日
  • 已采纳回答 10月7日
  • 创建了问题 10月7日