It's me!!! Me!!!
BMI計算
103一禮15 夏沐荷(資研)發表於2014年 10月 21日(二.) 17:10
#include <cstdlib>
#include <iostream>
#include <cmath>

using namespace std;

int main ()
{
    double hight,weight;
    double BMI;


    cin >> hight >> weight;

    BMI= weight/((hight)*(hight));

    if (BMI<18)
    {
        BMI=weight/((hight)*(hight));
        cout << "too light"<<endl;}
    else if (BMI>=18&&BMI<=24)
    {
        BMI=weight/((hight)*(hight));
        cout << "OK" <<endl;}

    else
{
    BMI=weight/((hight)*(hight));
    cout << "too heavy"<<endl;}

system ("pause");

return 0;
}