-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtask5.cpp
More file actions
29 lines (29 loc) · 738 Bytes
/
task5.cpp
File metadata and controls
29 lines (29 loc) · 738 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include <iostream>
using namespace std;
int main5()
{
int p1=0, p2=0;
cout << "Enter the 1st P and 2nd P move ";
cin >> p1>> p2;
if (p1 == 1 && p2 == 1)
cout << "Draw" << endl;
else if (p1 == 2 && p2 == 2)
cout << "Draw" << endl;
else if (p1 == 3 && p2 == 3)
cout << "Draw" << endl;
else if (p1 == 1 && p2 == 2)
cout << "Player 2 wins" << endl;
else if (p1 == 3 && p2 == 1)
cout << "Player 2 wins" << endl;
else if (p1 == 2 && p2 == 3)
cout << "Player 2 wins" << endl;
else if (p1 == 3 && p2 == 2)
cout << "Player 1 wins" << endl;
else if (p1 == 2 && p2 == 1)
cout << "Player 1 wins" << endl;
else if (p1 == 1 && p2 == 3)
cout << "Player 1 wins" << endl;
else
cout << "Invalid move" << endl;
return 0;
}