#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");
}
わかりましたので、私のコードは、入力した数字に関係なく「Underweight *」と出力し、理由がわかりません。誰かが私を正しい方向に向けることができれば、非常に感謝しています