当前位置:首页 » 编程语言 » 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 13:32:06 浏览:763
c语言表达式绝对值 发布:2025-07-01 13:25:45 浏览:489
获取网站访问量 发布:2025-07-01 13:20:28 浏览:291
平行线算法 发布:2025-07-01 13:10:13 浏览:601
c语言不可嵌套的是 发布:2025-07-01 13:04:33 浏览:329
三星手机老是显示存储空间不足 发布:2025-07-01 13:00:09 浏览:594
ewebeditor上传漏洞 发布:2025-07-01 13:00:08 浏览:836
电脑无解压 发布:2025-07-01 12:51:18 浏览:732
中国股票市场交易数据库 发布:2025-07-01 12:43:23 浏览:622
oppoa37怎么给应用加密 发布:2025-07-01 12:20:53 浏览:644