Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include<stdlib.h>
- #include<cmath>
- using namespace std;
- int main()
- {
- int r = 0, s = 1, p = 2, n, size;
- cout << "enter the size of tries" << endl;
- cin >> size;
- for (int i = 1; i <= size; i++) {
- cout << "enter 0 for rock, 1 for Siccor, 2 for papaer" << endl;
- cin >> n;
- if (n == 0) {
- if (rand() % 3 == 1)
- cout << "You're won, you choosed a Rock and computer choosed a scissor" << endl;
- else if (rand() % 3 == 2)
- cout << "You're lost, you choosed a Rock and computer choosed a paper" << endl;
- }
- else if (n == 1) {
- if (rand() % 3 == 2)
- cout << "You're won, you choosed a Scissor and computer choosed a paper" << endl;
- else if (rand() % 3 == 0)
- cout << "You're lost, you choosed a Scissor and computer choosed a rock" << endl;
- }
- else if (n == 2) {
- if (rand() % 3 == 0)
- cout << "You're won, you choosed a Paper and computer choosed a Rock" << endl;
- else if (rand() % 3 == 1)
- cout << "You're lost, you choosed a Paper and computer choosed a Scissor" << endl;
- }
- else
- cout << "Enter a right number" << endl;
- }
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment