题解 | 判断身材状态

#include <iostream>
using namespace std;
#define CHECK_CONDITION(bmi)           \    
        if ( bmi>24.9) {                \
            cout << "偏胖" << endl; \
        } else if (bmi > 20.9 ) {         \
            cout << "适中" << endl; \
        } else if (bmi >18.5 ) {         \
            cout << "苗条" << endl; \
        } else {                          \
            cout << "偏瘦" << endl; \
        }                                 
    
int main() {
   
    double weight;
    double height;

    cin >> weight;
    cin >> height;
    double bmi=weight/(height*height);
    // write your code here......
   CHECK_CONDITION(bmi);

    return 0;
}

全部评论

相关推荐

05-12 22:16
已编辑
北京邮电大学 研发工程师
牛客302360988号:0offer+1 滴滴都不给我面 佬没投鹅吗,鹅应该很喜欢北邮吧
投递美团等公司10个岗位
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务