#include<iostream>
#include<cmath>
#include<cstdlib>
using namespace std;
int main()
{
double height,weight,BMI;
cout << "請輸入身高(cm):";
cin >> height;
cout << "請輸入體重(kg):";
cin >> weight;
BMI = weight / (( height / 100 ) * ( height / 100 ));
cout << "BMI:" << BMI;
system("pause");
return 0;
}
|