- #include<iostream>
- #include<cstdlib>
- using namespace std;
- int main()
- {
- float height,weight,BMI;
- re:
- cout<<"請輸入您的身高(公尺):";
- cin>>height;
- if(height>=30)
- {
- cout<<"請問巨人先生 你吃什麼長那麼高"<<endl;
- goto re;
- }else if(height<0.3)
- {
- cout<<"矮胖子BJ4"<<endl;
- goto re;
- }
- re2:
- cout<<"請輸入您的體重(公斤):";
- cin>>weight;
- if(weight>=300)
- {
- cout<<"原來是頭豬壓"<<endl;
- goto re2;
- }else if(weight<=10)
- {
- cout<<"你還活著嗎 都看到骨頭了"<<endl;
- goto re2;
- }
- BMI=weight/(height*height);
- cout<<"您的BMI值為:"<<BMI<<endl<<"您的BMI分級為:";
- if(BMI<18.5)
- {
- cout<<"體重過輕!!太瘦了啦 都變成受了XD"<<endl;
- }else if(BMI>=18.5&&BMI<24)
- {
- cout<<"正常範圍!!要繼續保持唷M_<"<<endl;
- }else if(BMI>=24&&BMI<27)
- {
- cout<<"體重過重!!去去去去減肥"<<endl;
- }else if(BMI>=27&&BMI<30)
- {
- cout<<"體重過胖 你不是要交女朋友?"<<endl;
- }else if(BMI>=30&&BMI<35)
- {
- cout<<"體重超胖 你不要交女朋友了 其實男的也不錯 (##"<<endl;
- }else
- {
- cout<<"體重爆炸!?恭喜你爆炸囉"<<endl;
- }
- system("pause");
- return 0;
- }
複製代碼 |