题解 | #计算体重指数#
计算体重指数
http://www.nowcoder.com/practice/422f6341cf1b4212a7f8c703df111389
import java.util.Scanner;
public class Main{
public static void main(String[] args){
Scanner in = new Scanner(System.in);
String strs = in.nextLine();
String[] infos = strs.split(" ");
int weight = Integer.parseInt(infos[0]);
double height = Double.parseDouble(infos[1]) / 100;//单位:米
double BMI = weight / Math.pow(height, 2);
System.out.printf("%.2f", BMI);
}
}