#include
#include
int main
{
double hieght,weight,BMI;
printf("please enter your hight(m) and weight(kg):");
scanf("%4.9lf,%4.9lf",&height,&weight);
BMI=weight/pow(height,2);
if(BIM
printf("%ls","you are too thin!eat more!");
else if (BMI>=18.5&&BMI<=24.99)
printf("%ls","congratulation!you are prefectly normal!");
if(BIM>=25&&BIM<=28)
printf("%ls","be careful ,you are overweight now");
else (BMI>=28&&BMI<=32)?printf("%ls","you are too fat,watch out"):printf("%ls","Warning:It is danger to be this FAT!" );
return 0;
}
錯誤代碼main.c|4|error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token|
#include
#include
#include
int main ()
{
double height,weight,BMI;
printf("please enter your hight(m) and weight(kg):");
scanf("%4.9lf,%4.9lf",&height,&weight);
BMI=weight/pow(height,2);//寬度/高度的平方
if(BMI)
printf("%ls you are too thin!eat more!",BMI);
else if (BMI>=18.5&&BMI<=24.99)
printf("%ls congratulation!you are prefectly normal!",BMI);
if(BMI>=25&&BMI<=28)
printf("%ls be careful ,you are overweight now",BMI);
else (BMI>=28&&BMI<=32)?printf("%ls you are too fat,watch out",BMI):printf("%ls Warning:It is danger to be this FAT!",BMI);
return 0;
}
我隨便改了下你程序中的錯誤 現在能正確運行了 不過輸出什麼 我一直寫的是BMI 你看著改 不明白 你這樣寫是什麼意思
printf("%ls","you are too fat,watch out"); ????