#include "iostream" #include "cstdio" #include "cstring" #include "string" using namespace std; string a[] = { "A", "2", "3","4", "5", "6", "7", "8", "9", "10", "J", "Q", "K" }; int main() { int n; cin >> n; string s[2]; char c; for (int i = 0; i < n; i++) { cin >> c; cin >> s[0] >> s[1]; int len1 = s[0].size() - 1; int len2 = s[1].size() - 1; if (s[0][len1] == c&&s[1][len2] != c) { cout << "YES" << endl; continue; } if (s[1][len2] == c&&s[0][len1] != c) { cout << "NO" << endl; continue; } string d1, d2; int x, y; for (int j = 0; j <= len1; j++) { if (s[0][j] != 'S'&&s[0][j] != 'H'&&s[0][j] != 'D'&&s[0][j] != 'C') { d1 += s[0][j]; } } for (int j = 0; j <= len1; j++) { if (s[1][j] != 'S'&&s[1][j] != 'H'&&s[1][j] != 'D'&&s[1][j] != 'C') { d2 += s[1][j]; } } for (int j = 0; j < 13; j++) { if (d1 == a[j]) { x = j; } if (d2 == a[j]) { y = j; } } if (x > y) { cout << "YES" << endl; } else { cout << "NO" << endl; } } return 0; }
0.0分
0 人评分
输入输出格式练习 (C语言代码)浏览:883 |
C语言训练-斐波纳契数列 (C语言代码)浏览:644 |
C语言训练-最大数问题 (C语言代码)浏览:668 |
C语言训练-求PI* (C语言代码)浏览:520 |
计算表达式浏览:693 |
C语言程序设计教程(第三版)课后习题7.5 (C语言代码)(简单版)浏览:588 |
Manchester-蛇行矩阵,不需要数组,四个变量,解决问题浏览:6050 |
C二级辅导-进制转换 (C语言代码)正解浏览:855 |
WU-简单的a+b (C语言代码)浏览:879 |
还是畅通工程浏览:797 |