为什么输入70 1.72 是输出Underweight?急!
查看原帖
为什么输入70 1.72 是输出Underweight?急!
417053
bohao2008楼主2021/1/28 16:04
#include <iostream>
#include <iomanip>
using namespace std;
int main() {
	double m, h, a;
	cin >> m >> h;
	a = h * h/m;
	if (a < 18.5)
		cout << "Underweight";
	if (18.5 < a && a > 24)
		cout << "Normal";
	if (24 < a)
		cout << "Overweight";
	return 0;
}
2021/1/28 16:04
加载中...