This repository has been archived by the owner on May 23, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
p131.cpp
69 lines (60 loc) · 1.46 KB
/
p131.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
#include <string>
#include <iostream>
#include <sstream>
#include <vector>
#define IN "p131.in"
#define OUT "p131.out"
class Card {
private:
std::string card;
int number;
public:
Card(std::string c) {
card = c;
}
int getnumber() {
int r;
switch (card[1]) {
case 'A': r = 1; break;
case 'T': r = 10; break;
case 'J': r = 11; break;
case 'Q': r = 12; break;
case 'K': r = 13; break;
default: card[1] >> r;
}
return r;
}
char getsuit() {
return card[2];
}
};
int main (int argc, char const* argv[]) {
#ifndef ONLINE_JUDGE
close(0); open(IN, O_RDONLY);
// close(1); open(OUT, O_WRONLY | O_CREAT, 0600);
#endif
std::vector<Card> hand;
std::string line;
while (std::getline(std::cin, line)) {
std::istringstream linestream(line);
std::string c;
while (linestream >> c)
hand.push_back(c);
// hand processing
}
// switch(bestgame) {
// case 1: sprintf(beststr, "%s", "highest-card"); break;
// case 2: sprintf(beststr, "%s", "one-pair"); break;
// case 3: sprintf(beststr, "%s", "two-pairs"); break;
// case 4: sprintf(beststr, "%s", "three-of-a-kind"); break;
// case 5: sprintf(beststr, "%s", "straight"); break;
// case 6: sprintf(beststr, "%s", "flush"); break;
// case 7: sprintf(beststr, "%s", "full-house"); break;
// case 8: sprintf(beststr, "%s", "four-of-a-kind"); break;
// case 9: sprintf(beststr, "%s", "straight-flush"); break;
// }
return 0;
}