- #include<iostream>
- #include<ctime>
- using namespace std;
- int main()
- {
- srand(time(NULL));
- int p,c;
- cout<<"ROCK PAPER SCISSORS 1v1 WITH PC!!"<<endl;
- cout<<"Rock Paper Scissors! (1)Rock (2)Paper (3)Scissors";
- cin>>p;
- c=rand()%3+1;
- cout<<"You picked: ";
-
- if(p==1)
-
- cout<<"Rock!"<<endl;
-
- else if(p==2)
- cout<<"Paper!"<<endl;
-
- else if(p==3)
- cout<<"Scissors!"<<endl;
-
- cout<<"The PC picked: "
- if(c==1)
-
- cout<<"Rock!"<<endl;
- else if(c==2)
-
- cout<<"Paper!"<<endl;
- else if(c==3)
-
- cout<<"Scissors!"<<endl;
- system("pause");
- return 0;
- }
複製代碼 |