<p><span style="color: rgb(0, 0, 0); font-size: 12px; background-color: rgb(255, 255, 255);"><strong>/* Copyright (c) 2016</strong></span></p><p><span style="color: rgb(0, 0, 0); font-size: 12px; background-color: rgb(255, 255, 255);"><strong>* All rights reserved</strong></span></p><p><span style="color: rgb(0, 0, 0); font-size: 12px; background-color: rgb(255, 255, 255);"><strong>* 文件名称:2.cpp</strong></span></p><p><span style="color: rgb(0, 0, 0); font-size: 12px; background-color: rgb(255, 255, 255);"><strong>* 作者:刘丽</strong></span></p><p><span style="color: rgb(0, 0, 0); font-size: 12px; background-color: rgb(255, 255, 255);"><strong>* 完成日期:2016年 3 月 13 日</strong></span></p><p><span style="color: rgb(0, 0, 0); font-size: 12px; background-color: rgb(255, 255, 255);"><strong>* 版本号: v1.0</strong></span></p><p><span style="color: rgb(0, 0, 0); font-size: 12px; background-color: rgb(255, 255, 255);"><strong>*</strong></span></p><p><span style="color: rgb(0, 0, 0); font-size: 12px; background-color: rgb(255, 255, 255);"><strong>* 问题描述:</strong></span></p><p><span style="color: rgb(0, 0, 0); font-size: 12px;"><strong><strong><span style="font-size: 12px;">* </span></strong>计算身高对应的标准体重 </strong></span></p><p><span style="color: rgb(0, 0, 0); font-size: 12px; background-color: rgb(255, 255, 255);"><strong>* 输入描述:两个整数,即kg体重和cm身高</strong></span></p><p><span style="color: rgb(0, 0, 0); font-size: 12px; background-color: rgb(255, 255, 255);"><strong>* 程序输出:一个整数和一个字符串,即kgB标准体重,和对体重与标准体重的比较结果</strong></span></p><p><span style="color: rgb(0, 0, 0); font-size: 12px; background-color: rgb(255, 255, 255);"><strong>*/</strong></span></p><p><span style="color: rgb(0, 0, 0); font-size: 12px; background-color: rgb(255, 255, 255);"></span>#include <iostream>
using namespace std;
int main()
{
int kg,kgB,cm;//kg体重,cm身高,kgB标准体重
cin>>kg>>cm;
kgB=cm-100;
cout << "标准体重为:"<<kgB <<"kg"<< endl;
if(kg>1.2*kgB)
cout << "超重" << endl;
else if (kg<0.8*kgB)
cout << "超轻" << endl;
else
cout << "正常" << endl;
return 0;
}
</p>