题解 | #判断体重指数#
判断体重指数
https://www.nowcoder.com/practice/688f96cc38bb4a76996698d2f987b1b5
继续if else判断 在运用逻辑运算
double height= in.nextDouble();
double weight= in.nextDouble();
double bodx = weight / (height * height);
if ( bodx < 18.5){
System.out.println("偏瘦");
}else if (bodx >= 18.5 && bodx < 20.9){
System.out.println("苗条");
}else if (bodx >= 20.9 && bodx < 24.9){
System.out.println("适中");
}
if (bodx >= 24.9){
System.out.println("偏胖");
}