單位換算
public class Bmi { public static void main(String[] args) { double Hei=170,Wei=75; double Hei_m = 170/100.; //double bmi=Wei/(Hei/100)*(Hei/100); System.out.println(Hei_m); double bmi = Wei/(Hei_m*Hei_m); // System.out.println("(static value)Your name is = " +name); System.out.println("(static value)Your Bmi is = " +bmi); } }