-
Notifications
You must be signed in to change notification settings - Fork 0
/
part1.cpp
55 lines (53 loc) · 821 Bytes
/
part1.cpp
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
48
49
50
51
52
53
54
55
#include <bits/stdc++.h>
using namespace std;
enum HandEnum
{
five = 7,
four = 6,
house = 5,
three = 4,
twoPairs = 3,
onePair = 2,
highCard = 1
};
int getEnumForHand(string hand)
{
if (hand == "five-of-a-kind")
{
return five;
}
else if (hand == "four-of-a-kind")
{
return four;
}
else if (hand == "full-house")
{
return house;
}
else if (hand == "three-of-a-kind")
{
return three;
}
else if (hand == "two-pairs")
{
return twoPairs;
}
else if (hand == "pair")
{
return onePair;
}
else
{
return highCard;
}
}
int main()
{
string hand;
int val;
while (cin >> hand)
{
cin >> val;
cout << hand << " " << val << endl;
}
}