返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>      
  3. using namespace std;   
  4. int main()   
  5. {
  6.     char ans;
  7.     re:
  8.     cout<<"Brainless Question"<<endl;
  9.     cout<<"1+1=?  "<<endl;
  10.     cout<<"Answer (a) 1 (b) 2 (c) 3 (d) 6 "<<endl;
  11.     cin>>ans;
  12.     switch (ans)
  13.      {   
  14.          case 'a':
  15.              cout<<"wrong!"<<endl;
  16.              break;   
  17.          case 'b':
  18.             cout<<"Correct!"<<endl;
  19.             break;
  20.          case 'c':
  21.             cout<<"wrong!"<<endl;
  22.             break;        
  23.          case 'd':
  24.             cout<<"wrong!"<<endl;
  25.             break;
  26.          default:
  27.             cout<<"Eeror"<<endl;
  28.      }
  29.      goto re;
  30.     system("pause");      
  31.     return 0;     
  32. }
複製代碼

TOP

返回列表