当前位置:首页 » 编程语言 » mooc答案c语言

mooc答案c语言

发布时间: 2023-09-11 17:28:26

Ⅰ 中国大学moocc语言程序设计苏小红课程实验题为什么总是显示结果错误

#include <stdio.h>
main()
{
char sex,sports,diet;
float faHeight,moHeight,yourHeight;
printf("sex F or M: , fatherHeight and motherHeight: ,
Whether like sports Y or N: , Whether have good diet Y or N:\n");
scanf("%c,%f,%f,%c,%c",sex,faHeight,moHeight,sports,diet);
if (sex=='F'){
if (sports=='Y'){
if (diet=='Y'){
yourHeight=(faHeight*0.923+moHeight)*0.54*1.02*1.15;
}
else{
yourHeight=(faHeight*0.923+moHeight)*0.54*1.02;
}
}
else{
if (diet=='Y'){
yourHeight=(faHeight*0.923+moHeight)*0.54*1.15;
}
else{
yourHeight=(faHeight*0.923+moHeight)*0.54;
}
}
}
else {
if (sports=='Y'){
if (diet=='Y'){
yourHeight=(faHeight+moHeight)*0.5*1.02*1.15;
}
else{
yourHeight=(faHeight+moHeight)*0.5*1.02;
}
}
else{
if (diet=='Y'){
yourHeight=(faHeight+moHeight)*0.5*1.15;
}
else{
yourHeight=(faHeight+moHeight)*0.5;
yourHeight=(faHeight+moHeight)*0.5;
}
}
}
printf("yourHeight is %f cm",yourHeight);
}

热点内容
90岁老年人助听器如何配置 发布:2025-07-02 00:59:16 浏览:814
配置ip代理服务器加速软件 发布:2025-07-02 00:58:32 浏览:692
linux链接库 发布:2025-07-02 00:53:06 浏览:676
数据库的划分的 发布:2025-07-02 00:43:19 浏览:655
补码源码和 发布:2025-07-02 00:37:25 浏览:979
centos7mysql远程访问 发布:2025-07-02 00:35:58 浏览:712
有线认证服务器地址错误 发布:2025-07-02 00:33:22 浏览:278
本田思域2021款买哪个配置 发布:2025-07-02 00:31:43 浏览:326
安卓十二系统什么时候更新 发布:2025-07-02 00:12:28 浏览:346
shell脚本需要编译链接 发布:2025-07-02 00:04:20 浏览:475