就拿胖子说事

来源:互联网 发布:淘宝已付款取消订单 编辑:程序博客网 时间: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
原创粉丝点击