C语言入门级问题
题设要求将英尺转化为米后。如果同时满足身高高于1.6米,体重低于90kg则可以通过。程序如下:
#include <stdio.h>
main()
{
float a, b, m;
int w;
printf("Please enter the height (in feet and inches) like a,b (foot,inch) inside the earth as input data.\n");
scanf("%f,%f",&a,&b);
printf("The height in meter is.\n");
m=2.54*(12*a+b)/100;
printf("%f\n",m);
printf("Please enter the weight (in kilogram) as a number w inside the earth as input data.\n");
scanf("%f",&w);
if (m<1.6) printf ("Sorry, you are not able to go parachuting. \n");
if (m>1.6)
if (w>90) printf ("Congratulation! You are able to go parachuting! \n");
else printf ("Sorry, you are not able to go parachuting. \n");
return 0;
}
然而,为什么只要m>1.6就全是通过,哪里出现问题了额