题解 | #判断身材状态#

判断身材状态

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

#include using namespace std;

int main() {

double weight;
double height;

cin >> weight;
cin >> height;
double bmi=weight/(height*height);
if(bmi>24.9)
{
    cout<<"偏胖"<<endl;
}
else if(bmi>20.9)//这儿其实只要是满足大于20.9就可以,因为在执行时是按照顺序结构来进行执行;
{
    cout<<"适中"<<endl;
}
else if(bmi>18.5)
{
    cout<<"苗条"<<endl;
}
else
{
    cout<<"偏瘦"<<endl;
}
return 0;

}

全部评论

相关推荐

不愿透露姓名的神秘牛友
07-03 17:30
点赞 评论 收藏
分享
06-10 23:36
已编辑
首都经济贸易大学 C++
点赞 评论 收藏
分享
见见123:简历没有啥问题,是这个社会有问题。因为你刚毕业,没有工作经历,现在企业都不要没有工作经历的。社会病了。
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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