一问题及代码
/*
* 文件名称:标准体重
* 作 者:袁依梦
* 完成日期:2016 年 3 月 24 日
* 版 本 号:v1.0
* 对任务及求解方法的描述部分:
* 输入描述:身高和体重:
* 问题描述:
* 程序输出: 超重超轻正常
* 问题分析:
* 算法设计:
*/
#include<iostream>
using namespace std;
int main()
{
double weight,high,bweight;
cout<<"请输入身高和体重:";
cin>>high>>weight;
bweight=high-100;
if(weight>bweight*(1+0.2))
cout<<"超重"<<endl;
else if(weight<bweight*(1-0.2))
cout<<"超轻"<<endl;
else
cout<<"正常"<<endl;
return 0;
}
二 运行结果
三心得体会 其中出现了一些小错误但最终克服了