求高手指点迷津,可否帮忙检查一下,怎么输不出来呀
#include <stdio.h>#include <stdlib.h>
int main()
{
float faHeight,moHeight,yoHeight;
char sex,sports,diet;
scanf("%c\n%f\n%f\n%c\n%c",&sex,&faHeight,&moHeight,&sports,&diet);
if(sex==('M'||'n'))
{
yoHeight=(faHeight+moHeight)*0.54;
if(sports==('Y'||'y'))
{
yoHeight*=1+0.02;
if(diet==('Y'||'y'))
{
yoHeight*=1+0.015;
printf("Your future height will be %.0f(cm)\n",yoHeight);
}
else
{
printf("Your future height will be %.0f(cm)\n",yoHeight);
}
}
else
{
if(diet==('Y'||'y'))
{
yoHeight*=1+0.015;
printf("Your future height will be %.0f(cm)\n",yoHeight);
}
else
{
printf("Your future height will be %.0f(cm)\n",yoHeight);
}
}
}
else if(sex==('F'||'f'))
{
yoHeight=(faHeight*0.923+moHeight)/2;
if(sports==('Y'||'y'))
{
yoHeight*=1+0.02;
if(diet==('Y'||'y'))
{
yoHeight*=1+0.015;
printf("Your future height will be %.0f(cm)\n",yoHeight);
}
else
{
printf("Your future height will be %.0f(cm)\n",yoHeight);
}
}
else
{
if(diet==('Y'||'y'))
{
yoHeight*=1+0.015;
printf("Your future height will be %.0f(cm)\n",yoHeight);
}
else
{
printf("Your future height will be %.0f(cm)\n",yoHeight);
}
}
}
return 0;
}