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

热点内容
数据库或且 发布:2025-07-01 21:40:54 浏览:996
pythoneve 发布:2025-07-01 21:33:49 浏览:141
解压玩具怎么做只用水就可以做 发布:2025-07-01 20:52:56 浏览:160
解压放松室 发布:2025-07-01 20:52:43 浏览:124
存储器坏了 发布:2025-07-01 20:46:11 浏览:511
iphone怎么设锁屏密码 发布:2025-07-01 20:46:10 浏览:621
服务器如何处理千万请求 发布:2025-07-01 20:30:53 浏览:334
plsqldeveloperjob 发布:2025-07-01 20:29:59 浏览:805
剪切文件用什么配置 发布:2025-07-01 20:23:07 浏览:44
酷睿2020主要看哪些配置 发布:2025-07-01 20:23:06 浏览:261