返回列表 發帖
  1. #include<iostream>
  2. #include<ctime>
  3. using namespace std;
  4. int main()
  5. {
  6.     srand(time(NULL));
  7.     int p,c;
  8.     cout<<"ROCK PAPER SCISSORS 1v1 WITH PC!!"<<endl;
  9.     string n[]={"Rock!","Paper!","Scissors!"};
  10.     cout<<"Rock Paper Scissors! (1)Rock (2)Paper (3)Scissors";
  11.     cin>>p;
  12.     c=rand()%3+1;
  13.     cout<<"You picked: "<<n[p-1]<<endl;
  14.     cout<<"The PC Picked: "<<n[c-1]<<endl;
  15. system("pause");
  16. return 0;
  17. }
複製代碼

TOP

返回列表