0
#include <stdio.h>
#include <stdlib.h>
int main() {
double w, h, b;
printf("Enter your weight in pounds \n");
scanf("%d", &w);
printf("Enter your height in inches \n");
scanf("%d", &h);
h = h/12;
b = w*703/(h*h);
if (b < 18.5) {
printf("underweight");
} else if (b>=18.5 && b<25) {
printf("normal");
} else {
printf("overweight");
}
system("Pause");
}
好了,所以我的代码打印“减持*不管我输入什么号码,我不知道为什么。如果有人能指出我将不胜感激正确的方向BMI计算器不工作
谢谢!它现在:)正如你可能会说我只是学习C – user1984103
不要忘记接受! –
@ user1984103阅读您的C书和/或C参考。那里描述了'scanf()'和'%lf'! –