Advertisement
Guest User

Untitled

a guest
Oct 2nd, 2014
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.65 KB | None | 0 0
  1. #include<iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6.     double hei=0,wei=0,bmi=0;
  7.     cout<<"請輸入體重(磅或者公斤):";
  8.     cin>>wei;
  9.     cout<<"輸入身高"<<"\n";
  10.     cout<<"請注意:如果您在輸入體重時是使用\"\"為單位,請在此使用\"\"為單位,反之,則以公尺為單位"<<"\n";
  11.     cout<<"請輸入身高:";
  12.     cin>>hei;
  13.     bmi=wei/(hei*hei);
  14.     cout<<"您的BMI指數為:"<<bmi<<"\n";
  15.     cout<<"BMI VALUES"<<"\n";
  16.     cout<<"Underweight: less then 18.5"<<"\n";
  17.     cout<<"Normal:      between 18.5 and 24.9"<<"\n";
  18.     cout<<"overheight:  between 25 and 29.9"<<"\n";
  19.     cout<<"obese:       30 or greater"<<"\n";
  20.     system("pause");
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement