個人相片
BMI求值
一公22郭庭均 資研發表於2014年 10月 21日(二.) 17:11
#include <iostream>
#include <cmath>

using namespace std;

int main()
{
double height, weight;
double BMI;
cout << "Please key in your height.(cm)" <<endl ;
cin >> height ;
height = height * 0.01 ;
cout << "Please key in your weight.(kg)" <<endl ;
cin >> weight ;
BMI = weight / (height*height);
cout << "Your BMI is";
cout << BMI <<endl;

return 0;
}