Skip to content

Instantly share code, notes, and snippets.

import java.util.Scanner;
public class Body {
public static void MassIndex(double height,double weight){
double bmi= weight/(height * height);
if (bmi < 18.5){
System.out.print("体重过轻:低于18.5");
}else if(bmi >=18.5 && bmi <= 24.9){
System.out.print("正常:在18.5-255之间");
}else if(bmi >=25.0 && bmi <= 29.9){