错误显示illegal else without matching if,求大神指点
#include <stdlib.h>
#include <math.h>
#include <stdio.h>
int main()
{
char diet;
char sports;
char sex;
char M;
char F;
char Y;
char N;
float faHeight;
float moHeight;
float myHeight;
printf("please enter your Father's Height and your Mother's Height(cm)\n");
scanf("%f%f",&faHeight,&moHeight);
printf("if you are a boy,please enter'M',or enter'F'\n");
scanf(" %c",&sex);
if(sex==M);
{
myHeight=(faHeight+moHeight)*0.54;
printf("if you love sports ,please enter Y,or enter N\n");
scanf(" %c",&sports);
if(sports==Y);
{
myHeight=myHeight*(1+0.02);
printf("if you have healthy diet,please enter'Y',or enter'N'\n");
scanf(" %c",&diet);
if(diet==Y);
{
myHeight=myHeight*(1+0.02);
printf("your future height:%f\n",myHeight);
}
else if (diet==N);
{
printf("your future height:%f\n",myHeight);
}
}
else if(sports==N);
{
printf("if you have healthy diet,please enter'Y',or enter'N'\n");
if(diet==Y);
{
myHeight=myHeight*(1+0.02);
printf("your future height:%f\n",myHeight);
}
else(diet==N);
{
printf("your future height:%f\n",myHeight);
}
}
}
else(sex==F);
{
myHeight=(faHeight*0.923+moHeight)/2;
if(sports==Y);
{
myHeight=myHeight*(1+0.02);
printf("if you have healthy diet,please enter'Y',or enter'N'\n");
scanf(" %c",diet);
if(diet==Y);
{
myHeight=myHeight*(1+0.02);
printf("your future height:%f\n",myHeight);
}
else(diet==N);
{
printf("your future height:%f\n",myHeight);
}
}
else(sports==N);
{
printf("if you have healthy diet,please enter'Y',or enter'N'\n");
if(diet==Y);
{
myHeight=myHeight*(1+0.02);
printf("your future height:%f\n",myHeight);
}
else(diet==N);
{
printf("your future height:%f\n",myHeight);
}
}
}
return 0;
}