- #include<cstdlib>
- #include<ctime>
- using namespace std;
- int main()
- {
- int play,computer;
- re:
- cout<<"請出人! (1)陳其邁(2)蔡英文(3)陳時中";
- cin>> play;
- computer=rand()%3+1;
- if(play==1)
- cout<<"陳其邁"<<endl;
- else if(play==2)
- cout<<"蔡英文"<<endl;
- else if(play==3)
- cout<<"陳時中"<<endl;
- cout<<"國民黨出";
- if(computer==1)
- cout<<"韓國瑜"<<endl;
- else if(computer==2)
- cout<<"馬英9"<<endl;
- else
- cout<<"老師"<<endl;
- system("pause");
- return 0;
- }
複製代碼 |