为什么输入完母亲的身高就自动退出了
c语言吧
全部回复
仅看楼主
level 11
#include<stdio.h>
#define HEG 0.54
float height(float father, float mother);
int main()
{
float father;
float mother;
float son;
printf("请输入父亲的身高:\n");
scanf("%f", &father);
printf(" 请输入母亲的身高:\n");
scanf("%f", &mother);
son = height(father, mother);
printf("预测儿子身高: ");
printf("%.2f\n", son);
return 0;
}
float height(float father, float mother)
{
float son =(father+mother)*HEG;
return son;}
2022年02月03日 07点02分 1
level 11
能正常编译成exe
2022年02月03日 07点02分 2
level 12
没有问题。编译环境的问题
2022年02月03日 08点02分 4
level 12
2022年02月03日 08点02分 5
level 3
2022年02月03日 09点02分 6
level 1
加个暂停
2022年02月03日 11点02分 7
level 7
引用头文件Windows.h然后在主函数结尾加个system ("Pause"),或者直接在主函数结尾加getchar()
2022年02月03日 12点02分 9
level 7
不是代码有问题,纯粹是结果出来的太快了你看不到
2022年02月03日 13点02分 10
1