60分求助,不知道如何保留有效位数
查看原帖
60分求助,不知道如何保留有效位数
680434
shumu楼主2023/9/10 11:19
#include<bits/stdc++.h>
using namespace std;
int main() {
	double m,h,x;
	cin>>m>>h;
	x=m/(h*h);
	if(x<18.5) {
		cout<<"Underweight";
	}
	if(x>=18.5&&x<24) {
		cout<<"Normal";
	}
	if(x>=24) {
		cout<<x;
		cout<<"Overweight";
	}
}
2023/9/10 11:19
加载中...