返回列表 發帖
  1. #include <iostream>
  2. #include <cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     srand(time(NULL));   
  7.     int p,c;
  8.     string name[3]={"刀","石","網"};
  9.     cout<<"請出拳! (1)刀(2)石(3)網 ";
  10.     cin>>p;
  11.         cout<<"你出"<<name[p-1]<<endl;
  12.     c=rand()%3+1;
  13.         cout<<"電腦出"<<name[p-1]<<endl;     
  14.    system("pause");
  15.    return 0;
  16. }
複製代碼

TOP

返回列表