设faHeight为其父身高,moHeight为其母身高,身高预测公式为:?男性成人时身高=(faHeight+moHeight)*0.54(cm)?女性成人时身高=(faHeight*0.923+moHeight)/2(cm)此外,如果喜爱体育锻炼...
设faHeight为其父身高,moHeight为其母身高,身高预测公式为: ? 男性成人时身高 = (faHeight + moHeight) * 0.54(cm) ? 女性成人时身高 = (faHeight * 0.923 + moHeight) / 2(cm) 此外,如果喜爱体育锻炼,那么可增加身高2%,如果有良好的卫生饮食习惯,那么可增加身高1.5%。
#include
int main()
{
float faheight,moheight,a;
char sex,sport,habit;
printf("Please input: Father's height(space)Mother's height(cm)\n");
scanf("%d %d",&faheight,&moheight);
{
printf("IF THE BABY IS A BOY?(y or n)\n");
sex=getchar();
if(sex=='y')a=(faheight+moheight)*1.0*0.54;
if(sex=='n')a=(faheight*0.923+moheight)/2