forked from tanus786/CP-Codes-HackOctober-Fest-2023
-
Notifications
You must be signed in to change notification settings - Fork 0
/
1741-A
38 lines (37 loc) · 1.08 KB
/
1741-A
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
#include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
for (int i = 0; i < n; i++) {
string a,b;
cin>>a>>b;
int c[4]={0},d[4]={0};
for (int j = 0; j < a.size(); j++) {
if(a[j]=='L'){c[0]++;}
else if(a[j]=='M'){c[1]++;}
else if (a[j]=='S'){c[2]++;}
else if(a[j]=='X'){c[3]++;}
}
for (int j = 0; j < b.size(); j++) {
if(b[j]=='L'){d[0]++;}
else if(b[j]=='M'){d[1]++;}
else if (b[j]=='S'){d[2]++;}
else if(b[j]=='X'){d[3]++;}
}
if((c[0]==1&&(d[1]==1||d[2]==1))||(c[1]==1&&d[2]==1)){cout<<">\n";}
else if(c[0]==1&&d[0]==1){
if(c[3]>d[3]){cout<<">\n";}
else if(c[3]<d[3]){cout<<"<\n";}
else {cout<<"=\n";}
}
else if(c[2]==1&&d[2]==1){
if(c[3]>d[3]){cout<<"<\n";}
else if(c[3]<d[3]){cout<<">\n";}
else {cout<<"=\n";}
}
else if(c[1]==1&&d[1]==1){cout<<"=\n";}
else{cout<<"<\n";}
}
return 0;
}