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

热点内容
易语言gdi源码 发布:2025-08-18 13:06:05 浏览:781
iphone5s软件缓存 发布:2025-08-18 12:39:37 浏览:148
QQ推荐上传 发布:2025-08-18 12:38:51 浏览:860
qq忘记密保怎么找回密码 发布:2025-08-18 12:38:18 浏览:72
python字符串类型转换 发布:2025-08-18 12:35:54 浏览:399
ofdm信道估计算法 发布:2025-08-18 12:35:09 浏览:733
指数竞猜源码 发布:2025-08-18 12:29:26 浏览:698
天龙八部莫愁脚本官网 发布:2025-08-18 12:14:19 浏览:862
合资车为什么配置不高 发布:2025-08-18 12:09:36 浏览:76
银行的六位密码有多少种组合 发布:2025-08-18 12:06:27 浏览:397