返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.   a:
  7.   int x;
  8.   cout<<"請輸入你的分數:";
  9.   cin>>x;
  10.   if(x==100)
  11.   {
  12.     cout<<"滿分!保持!"<<endl;
  13.   }
  14.   else if(x>=60&&x<100)
  15.   {
  16.     cout<<"恭喜你及格了!"<<endl;
  17.   }
  18.   else if(x<60&&x>0)
  19.   {
  20.     cout<<"恭喜你不及格了!"<<endl;
  21.   }
  22.   else if(x==0)
  23.   {
  24.     cout<<"恭喜零分!繼續保持!"<<endl;
  25.   }
  26.   else
  27.   {
  28.     cout<<"輸入錯誤."<<endl;
  29.   }
  30.   goto a;
  31.   system("pause");   
  32.   return 0;
  33. }
複製代碼

TOP

返回列表