题解 | #健康评估#
健康评估
http://www.nowcoder.com/practice/08b28e61ff6345febf09969b3a167f7e
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main{
public static void main(String[] args) throws IOException{
BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
String[] str = bf.readLine().split(" ");
double weight = Double.parseDouble(str[0]);
double height = Double.parseDouble(str[1]);
double BMI = weight/(height*height);
if(BMI>=18.5 && BMI<=23.9){
System.out.println("Normal");
}
else{
System.out.println("Abnormal");
}
}
}
import java.io.IOException;
import java.io.InputStreamReader;
public class Main{
public static void main(String[] args) throws IOException{
BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
String[] str = bf.readLine().split(" ");
double weight = Double.parseDouble(str[0]);
double height = Double.parseDouble(str[1]);
double BMI = weight/(height*height);
if(BMI>=18.5 && BMI<=23.9){
System.out.println("Normal");
}
else{
System.out.println("Abnormal");
}
}
}
查看22道真题和解析