返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. #include<ctime>
  4. using namespace std;
  5. int main()
  6. {
  7.     srand (time(NULL));
  8.     pun:
  9.     int d,f;
  10.     string n[]={"剪刀","石頭","布"};
  11.     cout<<"還不快出 1.剪刀 2.石頭 3.布"<<endl;
  12.     cin>>d;
  13.     f=rand()%3+1;
  14.     cout<<"你出"<<n[d-1]<<endl;
  15.    
  16.     cout<<"電腦出"<<n[f-1]<<endl;
  17.     goto pun;
  18.    
  19.    
  20.     system("pause");
  21.     return 0;   
  22. }
複製代碼
hahahahahahahaha

TOP

返回列表