就拿胖子说事
来源:互联网 发布:淘宝已付款取消订单 编辑:程序博客网 时间:2024/04/30 13:54
/* * Copyright (c) 2016,烟台大学计算机与控制工程学院 * All rights reserved. * 文件名称:app.cpp * 作 者:王俊锐 * 完成日期:2016年3月8日 * 版 本 号:v1.0 * * 问题描述:成年男性的标准体重公式为:标准体重(kg)=身高(cm)-100,超标准体重20%为超重,比标准体重轻20%为超轻。输入身高体重,完成下面任务: (1)计算并输出标准体重。 [cpp] view plain copy (2)计算出标准体重,当超重时给出提示,不超重时也给提示。 (3)计算出标准体重,当超重时,请给出提示。 (4)计算出标准体重,输出体重状态(正常/超重/超轻) * 输入描述:输入两个整数,分别代表身高(cm)和 体重(kg) * 程序输出:输出体重状态以及标准体重 */
#include <iostream> using namespace std; int main() { int height,bz; cout<<"请输入身高:"; cin>> height ; bz = height-100; cout<<"标准体重:"<<bz<<endl; return 0; }
#include <iostream> using namespace std; int main() { int height,weight,bz; cout<<"请输入身高和体重:"; cin>> height >> weight; bz = height-100; if(weight>1.2*bz) { cout <<"超重"<<endl; } else { cout <<"不超重"<<endl; } return 0; }
#include <iostream> using namespace std; int main() { int height,weight,bz; cout<<"请输入身高和体重:"; cin>> height >> weight; bz = height-100; if(weight>1.2*bz) cout <<"超重"<<endl; return 0; }
#include <iostream> using namespace std; int main() { int height,weight,bz; cout<<"请输入身高和体重:"; cin>> height >> weight; bz = height-100; if(weight>1.2*bz) { cout <<"超重"<<endl; cout <<"体重状态:超重"<<endl; } else { cout <<"不超重"<<endl; if(weight<0.8*bz) cout <<"体重状态:超轻"<<endl; else cout <<"体重状态:正常"<<endl; } return 0; }
0 0
- 就拿胖子说事
- 就拿胖子说事
- 就拿胖子说事
- 就拿胖子说事
- 就拿胖子说事
- 就拿胖子说事
- 就拿胖子说事
- 就拿胖子说事
- 就拿胖子说事
- 就拿胖子说事
- 就拿胖子说事
- 就拿胖子说事
- 就拿胖子说事
- 【项目 2 - 就拿胖子说事】
- 项目2-就拿胖子说事
- 就拿胖子说事2
- 就拿胖子说事3
- 就拿胖子说事4
- 如何修改IIS_schema.xml文件?
- Object-C高级编程读书笔记(3)——Block的变量截取
- iOS - @class剖析
- STL iterator(迭代器)
- uva10041 - Vito's Family(求中位数)
- 就拿胖子说事
- C++卷积神经网络实例:tiny_cnn代码详解(1)——开篇
- 交大1104,整除问题
- java线程3
- iOS中资源分享
- Java中级软件工程师应该具备的知识点
- [译]A Verlet based approach for 2D game physics - Part Three
- Android中的缩略图制作
- Python Split函数的用法