當前位置:首頁 » 編程語言 » 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 20:52:56 瀏覽:159
解壓放鬆室 發布:2025-07-01 20:52:43 瀏覽:123
存儲器壞了 發布:2025-07-01 20:46:11 瀏覽:510
iphone怎麼設鎖屏密碼 發布:2025-07-01 20:46:10 瀏覽:620
伺服器如何處理千萬請求 發布:2025-07-01 20:30:53 瀏覽:332
plsqldeveloperjob 發布:2025-07-01 20:29:59 瀏覽:803
剪切文件用什麼配置 發布:2025-07-01 20:23:07 瀏覽:41
酷睿2020主要看哪些配置 發布:2025-07-01 20:23:06 瀏覽:259
sql保存文件 發布:2025-07-01 20:18:52 瀏覽:802
安卓做的登錄頁面怎麼運行 發布:2025-07-01 20:18:48 瀏覽:813