测测你的体重
来源:互联网 发布:mobiscroll.js 编辑:程序博客网 时间:2024/04/30 01:34
*烟台大学计算机学院学生 *All rights reserved. *文件名称:胖子伤不起 04.*作者:何新新 *完成日期:2013年2月27日 *版本号:v1.0 *对任务及求解方法的描述部分:胖子伤不起 *我的程序: #include <iostream> #include <string> using namespace std; struct students { string name; string sex; double high; double weight; }; int main() { students xue; cout<<"请输入学生的姓名:"; cin>>xue.name; cout<<"请输入学生的性别:"; cin>>xue.sex; cout<<"请输入学生的身高:"; cin>>xue.high; cout<<"请输入学生的体重"; cin>>xue.weight; double b_biao,g_biao,b1,g1,b2,g2; double sheng1,sheng2; b_biao=(xue.high-80)*0.7; g_biao=(xue.high-70)*0.6; b1=b_biao*0.1; g1=g_biao*0.1; b2=b_biao*0.2; g2=g_biao*0.2; sheng1=b_biao-xue.weight; sheng2=g_biao-xue.weight; if(xue.sex=="男") { if((sheng1<=b1&&sheng1>=0)||(sheng1<0&&sheng1>=(-b1))) cout<<"正常,身体保持的很好!!!"<<endl; else if((sheng1<=b2&&sheng1>b1)||(sheng1<(-b1)&&sheng1>(-b1))) { if(sheng1<0) cout<<"过重"<<endl; else cout<<"过轻"<<endl; } else { if(sheng1<0) cout<<"超重"<<endl; else cout<<"太轻"<<endl; } } if(xue.sex=="女") { if((sheng2<=g1&&sheng2>=0)||(sheng2<0&&sheng2>=(-g1))) cout<<"正常"<<endl; else if((sheng2<=g2&&sheng1>g1)||(sheng1<(-g1)&&sheng1>(-g1))) { if(sheng2<0) cout<<"过重"<<endl; else cout<<"过轻"<<endl; } else { if(sheng2<0) cout<<"超重"<<endl; else cout<<"太轻"<<endl; } } return 0; }
0 0
- 测测你的体重
- 测测你的记忆力
- 测测你的花心程度
- 测测你的升值潜力
- 测测你的人品怎么样
- 测测你的幼稚程度
- 测测你的杀毒软件行不行
- 测测你的韩国名字
- 测测你的过去未来
- 测测你的升值潜力
- 测测你的电脑是男是女?
- 测测你的温柔指数
- 测测你的java基本功
- 体重决定你的工资
- 你的体重标准么
- 你的体重标准否
- 测测你前世是干什么的
- 测测你是赚钱的料吗?
- hibernate缓存机制详细分析
- TCP socket异常关闭总结
- CSS :active 伪类
- Java中常见的接口与类----String类
- libnids api
- 测测你的体重
- Unity脚本的生命周期中几个重要的方法
- PhotoView 是一款扩展自Android ImageView
- 猴子选大王问题——约舍夫问题
- build.prop来源
- OCP-1Z0-053-V12.02-569题
- boot_init_stack_canary
- 算法导论之计数排序
- 转载:ZedGraph使用帮助