17周(胖子 大胖子 )
来源:互联网 发布:zookeeper nginx区别 编辑:程序博客网 时间:2024/04/28 10:45
/*
*copyright(c) 2014,烟台大学计算机学院
*All rights reserved。
*文件名称:17周(胖子 大胖子 )
*作者:王忠
*完成日期:2014.12.21
*版本号:v1.0
*
*问题描述:输入一个人的姓名性别身高体重,计算他的体重情况,并输出
*输入描述:输入一个人的姓名性别身高体重
*程序输出:计算他的体重情况,并输出
#include <iostream>using namespace std;struct information{ char name[20]; int sex; int length; int weight;};int main(){ double standard; int over; information peo; cout<<"输入姓名,性别(男1,女2),身高,体重"<<endl; cin>>peo.name>>peo.sex>>peo.length>>peo.weight; if(peo.sex==1) { standard=(peo.length-80)*0.7; if(standard*0.9<=peo.weight&&peo.weight<=standard*1.1) cout<<"体重正常"<<endl; if(standard*0.8<=peo.weight&&peo.weight<standard*0.9) cout<<"过轻"<<endl; if(standard*1.1<peo.weight&&peo.weight<=standard*1.2) cout<<"过重"<<endl; if(standard*1.2<peo.weight) { over=((peo.weight-standard)/standard)*100; cout<<"超重"<<over<<"%"<<endl; } } else { standard=(peo.length-70)*0.6; if(standard*0.9<=peo.weight&&peo.weight<=standard*1.1) cout<<"体重正常"<<endl; if(standard*0.8<=peo.weight&&peo.weight<standard*0.9) cout<<"过轻"<<endl; if(standard*1.1<peo.weight&&peo.weight<=standard*1.2) cout<<"过重"<<endl; if(standard*1.2<peo.weight) { over=((peo.weight-standard)/standard)*100; cout<<"超重"<<over<<"%"<<endl; }}return 0;}
1 0
- 17周(胖子 大胖子 )
- 胖子
- 胖子,胖子
- 17周项目3--胖子伤不起
- 第17周项目--胖子伤不起
- 第17周项目胖子伤不起
- 17-3胖子伤不起
- 第二周 胖子不说胖
- 第17周项目3-胖子伤不起
- 第17周项目3-胖子伤不起
- 第17周项目3 胖子伤不起
- 第17周项目3 胖子伤不起
- 第17周项目3-胖子伤不起
- 第17周项目3-胖子伤不起
- 第17周【项目 3 - 胖子伤不起】
- 第17周项目3胖子伤不起
- 17周课后自主-项目三-胖子伤不起
- 第17周项目3-胖子伤不起
- object属性的使用,主要是flash广告的使用
- (2) github 基础操作ABC中的ABC
- 黑马程序员——外企Objective-C面试题(英语版)——黑马 ios 技术博客
- 编程艺术之模板方法模式
- Java的向上转型与向下转型
- 17周(胖子 大胖子 )
- IOS基础面试题(二)
- 第17周项目7-电子词典结构体版
- 黑马程序员——iOS开发基础面试题(非常全面且附详细解释)——黑马 ios 技术博客
- POJ - 1155 (树形dp)
- 很久很久很久嘻嘻
- 代码高处走 从VC6到VC9移植代码问题说明
- 求如何利用struts2从本地解析一个cvs文件并显示在页面上
- c++ 句柄和指针的区别