第17周项目3-胖子伤不起
2014-12-20 18:53
267 查看
/* *Copyright (c) 2014,烟台大学计算机学院 *All rights reserved. *文件名称:Annpion.cpp *作者:王耀鹏 *完成日期:2014年12月19日 *版本号:v1.0 * *问题描述:计算出体重情况。 *输入描述:输入一个人的姓名、性别、身高、体重。 *程序输出:输出体重情况。 */ #include <iostream> using namespace std; struct person { char name[30]; char sex; int height; int weight; }; int main() { person Person; cout<<"input name,sex,height,weight"<<endl; cin>>Person.name>>Person.sex>>Person.height>>Person.weight; double standard; if(Person.sex=='m') { standard=(Person.height-80)*0.7; if(Person.weight<=1.1*standard&&Person.weight>=0.9*standard) cout<<"我是高富帅!"<<endl; else if(Person.weight>=0.8*standard&&Person.weight<0.9*standard) cout<<"我要吃吃吃!"<<endl; else if(Person.weight>1.1*standard&&Person.weight<=1.2*standard) cout<<"我要减减减!"<<endl; else if(Person.weight>1.2*standard) cout<<"我不是胖子!T_T"<<endl; else if(Person.weight<0.8*standard) cout<<"我不是排骨精!T_T"<<endl; else { standard=(Person.height-70)*0.6; if(Person.weight<=1.1*standard&&Person.weight>=0.9*standard) cout<<"我是白富美!"<<endl; else if(Person.weight>=0.8*standard&&Person.weight<0.9*standard) cout<<"我要吃吃吃!"<<endl; else if(Person.weight>1.1*standard&&Person.weight<=1.2*standard) cout<<"我要减减减!"<<endl; else if(Person.weight>1.2*standard) cout<<"我不是胖子!T_T"<<endl; else if (Person.weight<0.8*standard) cout<<"我不是排骨精!T_T"<<endl; return 0; } } return 0; }
运行结果:
相关文章推荐
- 第17周项目3胖子伤不起
- 第17周项目3-胖子伤不起
- 第17周上机实践项目3——胖子伤不起
- 第17周项目3 胖子伤不起
- 第17周项目3--胖子伤不起(初识结构体)
- 第17周项目3-胖子伤不起
- 第17周项目3-胖子伤不起(结构体类型)
- 第17周 项目3-胖子伤不起
- 2014秋C++第17周 项目3参考 胖子伤不起
- 第17周项目3-胖子伤不起
- 第17周项目胖子伤不起
- 第17周项目3-胖子伤不起
- 第17周项目3-胖子伤不起
- 第17周项目3 胖子伤不起
- 第17周项目--胖子伤不起
- 第17周项目3-胖子伤不起
- 第17周【项目 3 - 胖子伤不起】
- 第17周项目3 胖子伤不起
- 第17周项目3-胖子伤不起
- 第十七周 项目三--胖子伤不起