fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. void printVec(vector<char>& v) {
  5. for (char c : v) {
  6. cout << c;
  7. }
  8. cout << endl;
  9. }
  10.  
  11. int main() {
  12. int t;
  13. cin >> t;
  14. for(int i=0;i<t;i++){
  15. vector<char> v;
  16. string s;
  17. cin >> s;
  18. for(int i=0;i<s.size();i++){
  19. v.push_back(s[i]);
  20. }
  21. sort(v.begin(),v.end());
  22. //printVec(v);
  23. if(v.back() - v.front() == 2){
  24. cout << "?";
  25. }else if(v.front() == '<'){
  26. cout << v[0];
  27. }else if(v.back() == '>'){
  28. cout << '>';
  29. }else{
  30. cout << "=";
  31. }
  32. cout << endl;
  33. }
  34.  
  35. return 0;
  36. }
Success #stdin #stdout 0s 5280KB
stdin
4
>>>
<><=<
=
<<==
stdout
>
?
=
<