-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproblemnumber35.cpp
More file actions
47 lines (45 loc) · 985 Bytes
/
problemnumber35.cpp
File metadata and controls
47 lines (45 loc) · 985 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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include<iostream>
#include <string>
#include<array>
#include<vector>
using namespace std;
// function smulation rules to game scissorspaperrock
int scissorspaperrock(string chose1, string chose2) {
string scissors = "scissors";
string paper = "paper";
string rock = "rock";
if (chose1 == paper && chose2 == rock)
{
cout << "player one is win";
}
else if (chose2 == paper && chose1 == rock)
{
cout << "player two is win";
}
else if (chose1 == scissors && chose2 == paper)
{
cout << "player one is win";
}
else if (chose2 == scissors && chose1 == paper)
{
cout << "player two is win";
}
else if (chose1 == rock && chose2 == scissors)
{
cout << "player one is win";
}
else if (chose2 == rock && chose1 == scissors)
{
cout << "player two is win";
}
else
{
cout << "drrrraaaaw";
}
return 0;
}
int main() {
scissorspaperrock("paper", "paper");
return 0;
}
/*Let's play! You have to return which player won! In case of a draw return Draw!.*/