
int main(void)
{
float faHeight,moHeight,chHeight
printf("父亲的身高(cm):")
scanf("%f",&faHeight)
printf("母亲的侍雹身高(cm):")
scanf("%f",&moHeight)
printf("孩子的性别(M/F):")
getchar()
if(getchar() == 'M'){
chHeight = (faHeight + moHeight ) * 0.54
}else if(getchar() == 'F'){
镇灶 chHeight = (faHeight * 0.923 + moHeight)/2
}else{
chHeight = 0
}
老旅帆 getchar()
printf("是否喜爱体育锻炼(Y/N):")
if(getchar() == 'Y'){
chHeight *= 1.02
}
getchar()
printf("是否有良好的卫生饮食习惯(Y/N):")
if(getchar() == 'Y'){
chHeight *= 1.015
}
printf("预测的身高:%dcm\n",(int)(chHeight + 0.5))
return 0
}
12
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <拆态轮stdio.h>
#include <stdlib.h>
int main()
{
int sg,xb,tz,btz
printf("请输入性别:1--男性,0--女性\n")
scanf("%d",&xb)
printf("请输入身高,厘米\n")
scanf("%d"旅信,&sg)
printf("请输入体重,公斤闭芹\n")
scanf("%d",&tz)
if (xb==1) btz=sg-105
else btz=sg-110
if (tz <btz-2) printf("你偏瘦了!\n")
else if (tz >btz+2) printf("你偏胖了!\n")
else printf("你的体重正常!\n")
system("PAUSE")
return (0)
}
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)