-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path102_A.cpp
More file actions
53 lines (48 loc) · 664 Bytes
/
102_A.cpp
File metadata and controls
53 lines (48 loc) · 664 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
48
49
50
51
52
53
#include<iostream>
#include<vector>
#include<map>
using namespace std;
bool isGreat(char c1,char c2)
{
if(isalpha(c1) && isalpha(c2))
{
map<char,char>p;
p['T'] = 10;
p['J'] =11;
p['Q'] = 12;
p['K'] = 13;
p['A'] = 14;
return (p[c1] > p[c2]);
}
return c1>c2;
}
int main()
{
char c;
cin>>c;
string s1,s2;
cin>>s1>>s2;
if(s1[1] != c)
{
if(s1[1]==s2[1] && isGreat(s1[0],s2[0]))
{
cout<<"YES"<<endl;
return 0;
}
}
else if(s1[1] == c)
{
if(s1[1] == s2[1] && isGreat(s1[0],s2[0]))
{
cout<<"YES"<<endl;
return 0;
}
if(s1[1] != s2[1])
{
cout<<"YES"<<endl;
return 0;
}
}
cout<<"NO"<<endl;
return 0;
}