#include<bits/stdc++.h>
using namespace std;
int main(){
float wight=0,hight=0;
float BMI;
cin>>wight>>hight;
BMI=wight/(hight*hight);
if(BMI<18.5){
cout<<"Underweight";
}else if(BMI<=24){
cout<<"Normal";
}else{
cout<<BMI<<endl<<"Overweight";
}
return 0;
}
如题,这之中的
BMI=wight/(hight*hight);
换成了
BMI=wight/hight*hight
就不能得出正确答案了,请问是为啥???