#include "stdafx.h"
#include<stdio.h>
void main()
{
float faHeight,moHeight,myHeight;
char sex,sport,diet;
printf("You are F or M:\n");
scanf("%c",&sex);
printf("DO you like sport Y/N:\n");
scanf("%c",&sport);
printf("DO you diet Y/N:\n");
scanf("%c",&diet);
printf("please check in your father height:\n");
scanf("%f",&faHeight);
printf("please check in your mother height:\n");
scanf("%f",&moHeight);
if(sex=='M')
myHeight=(faHeight+moHeight)*0.54;
else
myHeight=(faHeight*0.923 + moHeight)/2;
if(sport=='Y')
myHeight=myHeight*(1+0.02);
if(diet=='Y')
myHeight=myHeight*(1+0.015);
printf("myHeight is %f \n",myHeight);
}
慕哥9229398
料青山看我应如是
相关分类