c语言身高预测的问题,帮忙看看我的代码哪里错了
#include<stdio.h>intmain(){doublefaHeight,moHeight;charsex,sports,diet;doublea,b,c,d;...
#include<stdio.h>int main(){ double faHeight,moHeight; char sex,sports,diet; double a,b,c,d; while(scanf("%c",&sex) != EOF){ getchar(); scanf("%lf %lf",&faHeight,&moHeight); if(sex == 'F'){ a = (faHeight * 0.923 + moHeight) / 2; scanf("%c",&sports); getchar(); if(sports == 'Y'){ c = a * 0.02 + a; }else if(sports == 'M'){ c = a; scanf("%c",&diet); getchar(); } if(diet == 'Y'){ d = c * 1.015; }else if(diet == 'M'){ d = c; } }else if(sex == 'M'){ b = (faHeight + moHeight) * 0.54; scanf("%c",&sports); getchar(); if(sports == 'Y'){ c = b * 1.02; }else if(sports == 'M'){ c = b; } scanf("%c",&diet); getchar(); if(diet == 'Y'){ d = c * 1.015; }else if(diet == 'M'){ d = c; } } printf("%.2lf\n",d); } return 0;} 下面是问题
展开
1个回答
2016-10-11
展开全部
程序的交互太差了,输入不少,却没有一句提示
~
~
追问
毕竟新手啊,不太懂,大神帮忙写一段给我对比一下吧
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询