蒟蒻求助,语言是C++
查看原帖
蒟蒻求助,语言是C++
1066942
DESKTOP303楼主2023/9/12 22:34

请问为什么这里得不出预定的结果,是哪里出现了低级错误吗?

#include <iostream>
#include <iomanip>
#include <math.h>
using namespace std;
int main()
{
	float m,h,x;
	cin>>m>>h;
	x=m/pow(h,2);
	if (x<18.5)
	cout<<"Underweight";
	else if (18.5<=x<24)
	cout<<"Normal";
	else if (x>=24)
	cout<<x<<endl<<"Overweight";
	return 0;
}

这里是结果错误结果

2023/9/12 22:34
加载中...