求一个C语言高手
答案:2 悬赏:30 手机版
解决时间 2021-01-07 13:16
- 提问者网友:藍了天白赴美
- 2021-01-07 04:41
求一个C语言高手
最佳答案
- 五星知识达人网友:逃夭
- 2021-01-07 05:46
相当简单的题。。作业以后要自己做,特别是编程题 不动手的话是学不会的哦
#include
void main()
{
char sex,sports,diet;
float faHeight,moHeight,myHeight;
printf("\nEnter your sex(M/F):");
scanf("%c",&sex);
printf("\nEnter your father's and mother's height(cm):");
scanf("%f%f",&faHeight,&moHeight);
printf("\nLike sport or not(Y/N):");
scanf("%c",&sport);
printf("\nHave helthy diet or not(Y/N):");
scanf("%c",&diet);
if(sex=='M')
myHeight=(faHeight + moHeight) * 0.54;
else
myHeight=(faHeight * 0.923 + moHeight) / 2;
if(sport=='Y')
myHeight=myHeight*1.02;
if(diet=='Y')
myHeight=myHeight*1.015;
printf("\nMy height:%f",myHeight);
}
#include
void main()
{
char sex,sports,diet;
float faHeight,moHeight,myHeight;
printf("\nEnter your sex(M/F):");
scanf("%c",&sex);
printf("\nEnter your father's and mother's height(cm):");
scanf("%f%f",&faHeight,&moHeight);
printf("\nLike sport or not(Y/N):");
scanf("%c",&sport);
printf("\nHave helthy diet or not(Y/N):");
scanf("%c",&diet);
if(sex=='M')
myHeight=(faHeight + moHeight) * 0.54;
else
myHeight=(faHeight * 0.923 + moHeight) / 2;
if(sport=='Y')
myHeight=myHeight*1.02;
if(diet=='Y')
myHeight=myHeight*1.015;
printf("\nMy height:%f",myHeight);
}
全部回答
- 1楼网友:酒安江南
- 2021-01-07 07:23
引用白天以后的回答:
相当简单的题。。作业以后要自己做,特别是编程题 不动手的话是学不会的哦
#include
void main()
{
char sex,sports,diet;
float faHeight,moHeight,myHeight;
printf("\nEnter your sex(M/F):");
scanf("%c",&sex);
printf("\nEnter your father's and mother's height(cm):");
scanf("%f%f",&faHeight,&moHeight);
printf("\nLike sport or not(Y/N):");
scanf("%c",&sport);
printf("\nHave helthy diet or not(Y/N):");
scanf("%c",&diet);
if(sex=='M')
myHeight=(faHeight + moHeight) * 0.54;
else
myHeight=(faHeight * 0.923 + moHeight) / 2;
if(sport=='Y')
myHeight=myHeight*1.02;
if(diet=='Y')
myHeight=myHeight*1.015;
printf("\nMy height:%f",myHeight);
}#include
void main()
{
char sex,sports,diet;
float faHeight,moHeight,myHeight;
printf("\nEnter your sex(M/F):");
scanf("%c",&sex);
printf("\nEnter your father's and mother's height(cm):");
scanf("%f%f",&faHeight,&moHeight);
printf("\nLike sport or not(Y/N):");
scanf("%c",&sport);
printf("\nHave helthy diet or not(Y/N):");
scanf("%c",&diet);
if(sex=='M')
myHeight=(faHeight + moHeight) * 0.54;
else
myHeight=(faHeight * 0.923 + moHeight) / 2;
if(sport=='Y')
myHeight=myHeight*1.02;
if(diet=='Y')
myHeight=myHeight*1.015;
printf("My height:%f”,myHeight);
}
相当简单的题。。作业以后要自己做,特别是编程题 不动手的话是学不会的哦
#include
void main()
{
char sex,sports,diet;
float faHeight,moHeight,myHeight;
printf("\nEnter your sex(M/F):");
scanf("%c",&sex);
printf("\nEnter your father's and mother's height(cm):");
scanf("%f%f",&faHeight,&moHeight);
printf("\nLike sport or not(Y/N):");
scanf("%c",&sport);
printf("\nHave helthy diet or not(Y/N):");
scanf("%c",&diet);
if(sex=='M')
myHeight=(faHeight + moHeight) * 0.54;
else
myHeight=(faHeight * 0.923 + moHeight) / 2;
if(sport=='Y')
myHeight=myHeight*1.02;
if(diet=='Y')
myHeight=myHeight*1.015;
printf("\nMy height:%f",myHeight);
}#include
void main()
{
char sex,sports,diet;
float faHeight,moHeight,myHeight;
printf("\nEnter your sex(M/F):");
scanf("%c",&sex);
printf("\nEnter your father's and mother's height(cm):");
scanf("%f%f",&faHeight,&moHeight);
printf("\nLike sport or not(Y/N):");
scanf("%c",&sport);
printf("\nHave helthy diet or not(Y/N):");
scanf("%c",&diet);
if(sex=='M')
myHeight=(faHeight + moHeight) * 0.54;
else
myHeight=(faHeight * 0.923 + moHeight) / 2;
if(sport=='Y')
myHeight=myHeight*1.02;
if(diet=='Y')
myHeight=myHeight*1.015;
printf("My height:%f”,myHeight);
}
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯