#include <iostream>
#include <locale>
using namespace std;
#pragma comment (linker, "/OPT:NOWIN98")
class Human
{
public:
int stature,weight;
void SetSex(string x,float y,float z)
{
if (x == "man")
man(y,z);
else if (x == "women")
women(y,z);
else
cout<<"请输入正确的性别: 男:man 女:women ."<<endl;
};
private:
void man(float x,float y)
{
float z = reckon(x,y/100);
cout<<"男性"<<endl;
if (z<20 && z>10)
cout<<"健康指数:"<<z<<" 偏瘦,有腹肌就完美了.."<<endl;
else if (z>=20 && z<=25)
cout<<"健康指数:"<<z<<" 标准身材,不胖不瘦."<<endl;
else if (z>25 && z<=30)
cout<<"健康指数:"<<z<<" 有点肥,好吃好喝好睡~"<<endl;
else if (z>30 && z<=35)
cout<<"健康指数:"<<z<<" 很胖,胸台还是跑跑步吧..."<<endl;
else if (z>35 && z<60)
cout<<"健康指数:"<<z<<"
[C++]体重/身高 BMI指数计算器
最新推荐文章于 2025-06-17 21:17:41 发布