import java.util.Scanner;
/*编写程序,根据输入的性别,身高,体重,计算体重指数BMI
BMI 是国际上常用的衡量人体胖瘦程度以及是否健康的一个标准,算法:kg/m2
标准:男性低于20, 女性低于19,属于过轻;男性20-25,女性19-24,属于适中;
男性25-30,女性24-29,属于过重;男性30-35,女性29-34,属于肥胖;男性高于35,女性高于34,属于非常肥胖。专家指出最理想的体重指数是22。*/
public class Bmi {
public static void main(String[] args) {
float height,weight, BMI;
System.out.print("请输入性别,身高/米,体重/kg");
Scanner yx= new Scanner(System.in);
char sex=yx.next().charAt(0);
height=yx.nextFloat();
weight=yx.nextFloat();
BMI=weight/(height*height);
if(sex=='男'){
if(BMI<20){
System.out.println("过轻");}
if(20<BMI&&BMI<25){