*以上為小我學習經驗,請參考書本
先來看看BMI值的公式:
*身高(尺)^2=身高(尺)x身高(尺)
#include <stdio.h>
#include <stdlib.h>
BMI=weight/(m*m); BMI的公式=體重/身高(尺)^2
%f 浮點數
%.1f 浮點數(算至小數點第一名)
if(BMI<18.5) 當BMI小於18.5
printf("Excessively light
"); 顯示Excessively light(過輕)
if(BMI>=18.5 && BMI<24) 當BMI大於等於18.5,小於24
printf("Normal
"); 顯示Normal(正常)
if(BMI>=24 && BMI<27) 當BMI大於等於24,小於27
printf("Overweight
"); 顯示Overweight(稍重)
if(BMI>=27 && BMI<30) 當BMI大於等於27,小於30
printf("Mild obese
"); 顯示Mild obese(太重)
if(BMI>=30 && BMI<35) 當BMI大於等於30翻譯社小於35
printf("Moderate obese
"); 顯示Moderate obese(太重)
if(BMI>=35) 當BMI大於等於35
printf("The specific weight is obese
"); 顯示The specific weight is obese(超重)
*參考資料:圖解C說話(書)
float height,m,weight,BMI; 宣佈height,m,weight翻譯社BMI為單精數浮點變數
system("PAUSE");
return 0;
}
BMI=體重/身高(尺)^2 *身高(公分)要換算成身高(公尺) 例如:170公分翻譯社要換算成1.7公尺
m=height/100; 將身高(公分)轉換成身高(公尺) m=身高(尺)
int main()
{
float height,m,weight翻譯社BMI;
printf("======BMI======
");
printf("Height(cm):");
scanf("%f",&height);
printf("Weight(kg):");
scanf("%f",&weight);
printf("===============
");
m=height/100;
BMI=weight/(m*m);
printf("BMI = %.1f
"翻譯社BMI);
if(BMI<18.5)
printf("Excessively light
");
if(BMI>=18.5 && BMI<24)
printf("Normal
");
if(BMI>=24 && BMI<27)
printf("Overweight
");
if(BMI>=27 && BMI<30)
printf("Mild obese
");
if(BMI>=30 && BMI<35)
printf("Moderate obese
");
if(BMI>=35)
printf("The specific weight is obese
");
文章來自: http://n49817024.pixnet.net/blog/post/19494996-%E7%B0%A1%E6%98%93%E7%9A%84bmi%E5%80%BC%E8%A8%88%E7%A有關各國語文翻譯公證的問題歡迎諮詢天成翻譯公司02-77260931