赞
踩
package p1;
import java.util.Scanner;
public class test4 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
double BMI;
double height;
double weight;
System.out.println("##########BIM检测##########");
System.out.print("请输入你的体重(公斤):");
weight = sc.nextDouble();//通过input实例来读取一个double型数
System.out.print("请输入你的身高(米);");
height = sc.nextDouble();
BMI = weight/(height*height);
System.out.println("你的BMI的值为:"+BMI);
sc.close();
}
}
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。