返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     float x;
  7.     re:
  8.     cout<<"請輸入您成績: ";
  9.     cin>>x;
  10.     if(x==100)
  11.     {
  12.         cout<<"滿分!真厲害!"<<endl;
  13.         
  14.     }
  15.     else if(x>=60 && x<100)
  16.     {
  17.          cout<<"恭喜你及格了!"<<endl;
  18.          
  19.     }
  20.     else if(x<60 && x>0)
  21.     {
  22.          cout<<"不及格,再接再厲。"<<endl;
  23.          
  24.     }
  25.     else if(x==0)
  26.     {
  27.          cout<<"零分?斬!"<<endl;
  28.          
  29.     }
  30.     else
  31.     {
  32.          cout<<"輸入錯誤!"<<endl;
  33.          
  34.     }
  35.     goto re;
  36.     system("pause");
  37.     return 0;
  38. }
複製代碼

TOP

返回列表