Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- int main()
- {
- double hei=0,wei=0,bmi=0;
- cout<<"請輸入體重(磅或者公斤):";
- cin>>wei;
- cout<<"輸入身高"<<"\n";
- cout<<"請注意:如果您在輸入體重時是使用\"磅\"為單位,請在此使用\"吋\"為單位,反之,則以公尺為單位"<<"\n";
- cout<<"請輸入身高:";
- cin>>hei;
- bmi=wei/(hei*hei);
- cout<<"您的BMI指數為:"<<bmi<<"\n";
- cout<<"BMI VALUES"<<"\n";
- cout<<"Underweight: less then 18.5"<<"\n";
- cout<<"Normal: between 18.5 and 24.9"<<"\n";
- cout<<"overheight: between 25 and 29.9"<<"\n";
- cout<<"obese: 30 or greater"<<"\n";
- system("pause");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement