#include <stdio.h>
main()
{
float height,faHeight,moHeight;
char sex,sports,diet;
printf("请输入被测人信息:性别,是否喜爱运动,是否饮食良好:");
scanf("%f,%f,%f,%c,%c,%c",&height,&faHeight,&moHeight,&sex,&sports,&diet);
if(sex=='F' && sports=='Y' && diet=='Y')
{
height=((faHeight*0.923+moHeight)/2)*(1+0.02+0.015);
printf("%f",height);
}
else if(sex=='F' && sports=='Y' && diet=='N')
{
height=((faHeight*0.923+moHeight)/2)*(1+0.02);
printf("%f",height);
}
else if(sex='F' && sports=='N' && diet=='Y')
{
height=((faHeight*0.923+moHeight)/2)*(1+0.015);
printf("%f",height);
}
else if(sex=='F' && sports=='N' && diet=='N')
{
height=((faHeight*0.923+moHeight)/2);
printf("%f",height);
}
else if(sex=='M' && sports=='Y' && diet=='Y');
{
height=((faHeight+moHeight)*0.54)*(1+0.02+0.15);
printf("%f",height);
}
else if(sex=='M' && sports=='Y' && diet=='N')
{
height=((faHeight+moHeight)*0.54)*(1+0.02);
printf("%f",height);
}
else if(sex=='M' && sports=='N' && diet=='Y');
{
height=((faHeight+moHeight)*0.54)*(1+0.015);
printf("%f",height);
}
else
{
height=(faHeight+moHeight)*0.54;
printf("%f",height);
}
}