forked from kishanrajput23/leetcode-solutions-1
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathShirtSize.cpp
More file actions
115 lines (113 loc) · 2.89 KB
/
ShirtSize.cpp
File metadata and controls
115 lines (113 loc) · 2.89 KB
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
// shree ganeshay namah
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pi (3.141592653589)
#define mod 1000000007
#define ll long long
#define float double
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define all(c) c.begin(), c.end()
#define min3(a, b, c) min(c, min(a, b))
#define min4(a, b, c, d) min(d, min(c, min(a, b)))
#define rrep(i, n) for (int i = n - 1; i >= 0; i--)
#define rep(i, n) for (int i = 0; i < n; i++)
#define fast ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
int main()
{
int t;
cin >> t;
while (t--)
{
string a, b;
cin >> a >> b;
int n1 = a.length();
int n2 = b.length();
char x = a.at(n1 - 1);
char y = b.at(n2 - 1);
if (n1 == n2)
{
if (x == y)
{
cout << "=" << endl;
}
if ((x == 'M') && (y == 'S'))
{
cout << ">" << endl;
}
if ((x == 'S') && (y == 'M'))
{
cout << "<" << endl;
}
if ((x == 'L') && (y == 'S'))
{
cout << ">" << endl;
}
if ((x == 'S') && (y == 'L'))
{
cout << "<" << endl;
}
if ((x == 'L') && (y == 'M'))
{
cout << ">" << endl;
}
if ((x == 'M') && (y == 'L'))
{
cout << "<" << endl;
}
}
if (n1 != n2)
{
if (x == y)
{
if ((x == 'L') && (n1 > n2))
{
cout << ">" << endl;
}
if ((x == 'L') && (n2 > n1))
{
cout << "<" << endl;
}
if ((x == 'S') && (n1 > n2))
{
cout << "<" << endl;
}
if ((x == 'S') && (n2 > n1))
{
cout << ">" << endl;
}
}
if (x != y)
{
if ((x == 'M') && (y == 'S'))
{
cout << ">" << endl;
}
if ((x == 'S') && (y == 'M'))
{
cout << "<" << endl;
}
if ((x == 'L') && (y == 'S'))
{
cout << ">" << endl;
}
if ((x == 'S') && (y == 'L'))
{
cout << "<" << endl;
}
if ((x == 'L') && (y == 'M'))
{
cout << ">" << endl;
}
if ((x == 'M') && (y == 'L'))
{
cout << "<" << endl;
}
}
}
}
return 0;
}