# AOJ 491.扑克牌

Time Limit: 1000 ms   Case Time Limit: 1000 ms   Memory Limit: 64 MB
Total Submission: 54   Submission Accepted: 24

Description

3,4,5,6,7,8,9,10,J,Q,K,A,2

Input

Output

Sample Input

 Original Transformed
```2
3 3
A K
```

Sample Output

 Original Transformed
```=
>```

``` 1 /*
2 By:OhYee
3 Github:OhYee
4 Email:[email protected]
5 */
6 #include <cstdio>
7 #include <algorithm>
8 #include <cstring>
9 #include <cmath>
10 #include <string>
11 #include <iostream>
12 #include <vector>
13 #include <list>
14 #include <stack>
15 using namespace std;
16
17 #define REP(n) for(int o=0;o<n;o++)
18
19 const char d[13] = {‘3‘,‘4‘,‘5‘,‘6‘,‘7‘,‘8‘,‘9‘,‘1‘,‘J‘,‘Q‘,‘K‘,‘A‘,‘2‘};
20
21 int main() {
22     int T;
23     scanf("%d",&T);
24     REP(T) {
25         char a[3],b[3];
26         scanf("\n%s%s\n",&a,&b);
27         if(a[0] == b[0]) {
28             printf("=\n");
29             continue;
30         }
31         int i,j;
32         for(i = 0;i < 13;i++)
33             if(d[i] == a[0])
34                 break;
35         for(j = 0;j < 13;j++)
36             if(d[j] == b[0])
37                 break;
38         printf("%c\n",i < j ? ‘<‘ : ‘>‘);
39     }
40     return 0;
41 }```

## 【剑指offer】：Q44：扑克牌的顺子

def IsContinuous(seq, num = 5): zeros = 0; d = 0 seq = sorted(seq) for i in range(num - 1): if seq[i] == 0: zeros += 1 continue if seq[i] == seq[i + 1]: return False d += seq[i + 1] - seq[i] - 1 return zeros >= d [剑指offer]:Q44:扑克牌的顺子,布布扣,bubuko.com