是if-else的问题不会解,求教,谢谢!
#include "stdio.h"main ()
{
char sex,sports,diet;
double faheight,moheight,height;
printf("请输入性别,男性为:M,女性为:F :");
scanf("%c",&sex);
if(sex=='M') printf ("体育锻炼,喜爱:Y,不喜爱:N :");
scanf("%c",&sports);
if(sports=='Y') printf("饮食习惯,良好:Y,不好:N :");
scanf("%c",&diet);
if(diet=='Y') printf("父亲身高:,母亲身高:");
scanf("%lf%lf",&faheight,&moheight);
height=(faheight+moheight)*0.54*1.035;
printf("成人身高=%lf\n",&height);
else (diet=='N') printf("父亲身高:,母亲身高:");
scanf("%lf%lf",&faheight,&moheight);
height=(faheight+moheight)*0.54*1.02;
printf("成人身高=%lf\n",height);
else (sports=='N') printf("父亲身高:,母亲身高:");
scanf("%lf%lf",&faheight,&moheight);
height=(faheight+moheight)*0.54;
printf("成人身高=%lf\n",height");
else (sex=='F') printf ("体育锻炼,喜爱:Y,不喜爱:N :");
scanf("%c",&sports);
if(sports=='Y') printf("饮食习惯,良好:Y,不好:N :");
scanf("%c",&diet);
if(diet=='Y') printf("父亲身高:,母亲身高:");
scanf("%lf%lf",&faheight,&moheight);
height=(faheight*0.923+moheight)*0.54*1.035;
printf("成人身高=%lf\n",height);
else (diet=='N') printf("父亲身高:,母亲身高:");
scanf("%lf%lf",&faheight,&moheight);
height=(faheight*0.923+moheight)*0.54*1.02;
printf("成人身高=%lf\n",height);
else (sports=='N') printf("父亲身高:,母亲身高:");
scanf("%lf%lf",&faheight,&moheight);
height=(faheight*0.923+moheight)*0.54;
printf("成人身高=%lf\n",height);
}