#include<stdio.h>
int main(void)
{
char sex,sport,diet;
double faHeight,moHeight,kidHeight;
printf("faHeight and moHeight=%lf%lf",faHeight,moHeight);
scanf("%lf%lf",faHeight,moHeight);
printf("sex=%c",sex);
sex=getchar();
printf("sport=%c",sport);
sport=getchar();
printf("diet=%c",diet);
diet=getchar();
kidHeight=0;
switch(sex){
case'M':
if((sport=='Y')&&(diet=='N')){
kidHeight=(faHeight+moHeight)*0.54*1.02;
printf("kidHeight=%lf\n",kidHeihgt);
}
else if((sport=='N')&&(diet=='Y')){
kidHeight=(faHeight+moHeight)*0.54*1.015;
printf("kidHeight=%lf\n",kidHeight);
}
else if((sport=='Y')&&(diet=='Y')){
kidHeight=(faHeight+moHeight)*0.54*1.02*1.015;
printf("kidHeight=%lf\n",kidHeight);
}
else if((sport=='N')&&(diet=='N')){
kidHeight=(faHeight+moHeight)*0.54;
printf("kidHeight=%lf\n",kidHeight);
}
else{
printf("some of errors!\n");
}
break;
case'F':
if((sport=='Y')&&(diet=='N')){
kidHeight=(faHeight*0.923+moHeight)/2*1.02;
printf("kidHeight=%lf",kidHeight);
}
else if((sport=='N')&&(diet=='Y')){
kidHeight=(faHeight*0.923+moHeight)/2*1.015;
printf("kidHeight=%lf",kidHeight);
}
else if((sport=='Y')&&(diet=='Y')){
kidHeight=(faHeight*0.923+moHeight)/2*1.02*1.015;
printf("kidHeight=%lf",kidHeight);
}
else if((sport=='N')&&(diet=='N')){
kidHeight=(faHeight*0.923+moHeight)/2;
printf("kidHeight=%lf",kidHeight);
}
else{
printf("some of errors!\n");
}
break;
default:
printf("some of errors!\n");
break;
}
return 0;
}
为什么编译出错了。。。