当前位置:首页 » 编程语言 » 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);
}

热点内容
求生之路2虐电脑服务器 发布:2025-03-11 05:35:40 浏览:630
编译学堂 发布:2025-03-11 05:31:06 浏览:182
苹果文件夹隐藏 发布:2025-03-11 05:26:42 浏览:544
短信设置密码如何关闭 发布:2025-03-11 05:26:39 浏览:913
re管理器主文件夹 发布:2025-03-11 05:26:37 浏览:712
手机优酷缓存在哪 发布:2025-03-11 05:25:58 浏览:432
摩擦引流脚本 发布:2025-03-11 05:17:31 浏览:543
中国电信的路由器密码在哪里更改 发布:2025-03-11 05:10:40 浏览:686
我的世界电脑服务器必用指令 发布:2025-03-11 05:10:31 浏览:631
多集群缓存设计 发布:2025-03-11 05:00:31 浏览:459