题解 | #判断身材状态#

判断身材状态

https://www.nowcoder.com/practice/6f4afb0f8be64d5eaf65a205b8584888

#include <iostream>
#include <cmath>
using namespace std;

int main() {
    double weight;
    double height;
    cin >> weight;
    cin >> height;
    double x= pow(height,2);
    if(weight/x<=18.5)
        cout<<"偏瘦";
    else if(weight/x>=18.5&&weight/x<20.9)
        cout <<"苗条";
    else if (weight/x>=20.9&&weight/x<=24.9)
        cout <<"适中";
    else
        cout <<"偏胖";
    return 0;
}

全部评论

相关推荐

10-29 15:51
嘉应学院 Java
后端转测开第一人:你把简历的学历改成北京交通大学 去海投1000份发现基本还是没面试
点赞 评论 收藏
分享
allin实习的大白...:我把第二个项目发出来了,如果感兴趣可以去研究研究,欢迎交流。 https://gitee.com/jtyjtyjty333/ind-dist-ai-sec-edge-cloud https://github.com/jtylab/ind-dist-ai-sec-edge-cloud
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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