第3个数据为啥错了,只有80分?
查看原帖
第3个数据为啥错了,只有80分?
521503
愿秃头mekit楼主2021/7/20 18:50
#include<bits/stdc++.h>
using namespace std;
int main()
{
	double weight,h,BMI;
	cin>>weight>>h;
  if(weight>=40&&weight<=120&&h>=1.4&&h<=2.0)
   {
	BMI=weight/(h*h);
	if(BMI<18.5)
	{
		cout<<"Underweight"<<endl;
	}
	if(BMI>=18.5&&BMI<24)
	{
		cout<<"Normal"<<endl;
	}
	else
	{
	    cout << setprecision(6) << BMI<<endl; 
		cout<<"Overweight";
	}
   }
	return 0;
 } 
2021/7/20 18:50
加载中...