C++自编身高
来源:互联网 发布:烟台唯佳网络 编辑:程序博客网 时间:2024/04/28 00:46
#include <iostream>
using namespace std;
int main()
{
float faHeight,moHeight ,w;
char sex;
char likeSport,goodHabbit ;
cout<<"请输入性别:(f(女)/m(男))";
cin>>sex;
cout<<"请输入faHeight:";
cin>>faHeight;
cout<<"请输入moHeight";
cin>>moHeight;
cout<<"喜爱体育锻炼?(y/n):";
cin>>likeSport;
cout<<"良好卫生饮食习惯?(y/n)";
cin>>goodHabbit;
if (sex=='m'||sex=='M')
{ w=(faHeight+moHeight)*0.54;
if (likeSport=='y')
cout<<"w="<<w*1.02;
else if (goodHabbit=='y')
cout<<"w="<<w*1.015;
else if (likeSport=='y' && goodHabbit=='y')
cout<<"w="<<w*1.02*0.015;
else
cout<<"w="<<w;
}
else
{w=(faHeight*0.923+moHeight)/2;
if (likeSport=='y')
cout<<"w="<<w*1.02;
else if (goodHabbit=='y')
cout<<"w="<<w*1.015;
else if (likeSport=='y' && goodHabbit=='y')
cout<<"w="<<w*1.02*0.015;
else
cout<<"w="<<w;
}
return 0;
}
- C++自编身高
- C语言 MOOC 身高
- 身高
- C++Builder 自编常用函数库(1)
- C++Builder 自编常用函数库(2)
- C语言 身高与体重--完美身材
- [C++]体重/身高 BMI指数计算器
- C++ ,预测身高程序
- 自编自用DataProxy
- 自编短信笑话
- 自编Replace方法
- 没什么......自编而已!~
- Python自编教程
- 自编程序
- 自编程序
- 自编程序
- 自编程序
- 自编程序
- C语言的枚举类型
- A Mainframe IDE Powered By Unix Technology [11] - Submit JCL from ftp command or shell script
- Axcontrols与controls的区别、axmapcontrol与maptcontrol的区别
- Java中堆和栈的区别
- 博客吗
- C++自编身高
- snmp v3 结构
- 输入成绩并以负数结束
- 学习Linux网络编程教材
- Linux环境变量设置
- 在路由器中设置DNS有什么作用
- getchar()和EOF总结
- linux双网卡网段网关流控配置
- JAVA 调用Web Service的方法