解题思路:
1.创建变量m和h,输入两个变量的值
2.计算出对应的BMI,根据取值范围利用else if多分支语句输出
#include<bits/stdc++.h>
using namespace std;
int main()
{
double m,h;
cin>>m>>h;
double bmi=m/(h*h);
if(bmi<18.5)
cout<<"Underweight";
else if(bmi<24)
cout<<"Normal";
else
{
cout<<bmi<<endl;
cout<<"Overweight";
}
return 0;
}