返回列表 發帖
  1. #include<cstdlib>
  2. #include<ctime>
  3. using namespace std;
  4. int main()
  5. {
  6.     int play,computer;
  7.     re:
  8.     cout<<"請出人! (1)陳其邁(2)蔡英文(3)陳時中";
  9.     cin>> play;
  10.     computer=rand()%3+1;
  11.     if(play==1)
  12.      cout<<"陳其邁"<<endl;
  13.     else if(play==2)
  14.      cout<<"蔡英文"<<endl;
  15.     else if(play==3)
  16.      cout<<"陳時中"<<endl;
  17.     cout<<"國民黨出";
  18.     if(computer==1)
  19.         cout<<"韓國瑜"<<endl;
  20.     else if(computer==2)
  21.         cout<<"馬英9"<<endl;
  22.     else
  23.         cout<<"老師"<<endl;                                                   
  24.     system("pause");
  25.     return 0;
  26. }
複製代碼

TOP

返回列表