就拿胖子说事

问题及描述

/*
 *copyright(c) 2014,烟台大学计算机学院
 *All rights reserved
 *文件名称:test.cpp
 *作者:杨昊
 *版本:v6.0
 *
 *问题描述:输入体重身高,判断相关情况
 *输入描述:两个数,代表身高体重
 *程序输出:判断是否超重的问题
*/

#include<iostream>
using namespace std;
int main()
{
 float shengao,tizhong,biaozhun;
 cout<<"请输入身高"<<endl;
 cin>>shengao;
 biaozhun=shengao-100;
 cout<<biaozhun<<endl;
 cout<<"请输入身高和体重"<<endl;
 cin>>shengao>>tizhong;
 biaozhun=shengao-100;
    if(tizhong>biaozhun*1.2)
  cout<<"您已经超重了"<<endl;
 cout<<"请输入身高和体重"<<endl;
 cin>>shengao>>tizhong;
 biaozhun=shengao-100;
    if(tizhong>biaozhun*1.2)
  cout<<"您已经超重了"<<endl;
 else
 cout<<"您没有超重!"<<endl;
 cout<<"请输入身高和体重"<<endl;
 cin>>shengao>>tizhong;
 biaozhun=shengao-100;
    if(tizhong>biaozhun*1.2)
  cout<<"您已经超重了"<<endl;
 else  if(tizhong<biaozhun*0.8)
  cout<<"您太轻了"<<endl;
 else
  cout<<"您没有超重!"<<endl;
}


就拿胖子说事_第1张图片

你可能感兴趣的:(就拿胖子说事)