fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. string one,sign,two,check="false";
  6. cin>>one>>sign>>two;
  7. if(one.size()>two.size())
  8. {
  9. if(sign==">")
  10. {
  11. cout<<"TAK";
  12. }
  13. else if(sign=="!=")
  14. {
  15. cout<<"TAK";
  16. }
  17. else if(sign==">=")
  18. {
  19. cout<<"TAK";
  20. }
  21. else
  22. {
  23. cout<<"NIE";
  24. }
  25. }
  26. else if(two.size()>one.size())
  27. {
  28. if(sign=="<")
  29. {
  30. cout<<"TAK";
  31. }
  32. else if(sign=="!=")
  33. {
  34. cout<<"TAK";
  35. }
  36. else if(sign=="<=")
  37. {
  38. cout<<"TAK";
  39. }
  40. else
  41. {
  42. cout<<"NIE";
  43. }
  44. }
  45. else
  46. {
  47. for(int i=0;i<one.size();i++)
  48. {
  49. if(one[i]>two[i])
  50. {
  51. if(sign=="!=")
  52. {
  53. check="true";
  54. }
  55. else if(sign==">")
  56. {
  57. check="true";
  58. }
  59. else if(sign==">=")
  60. {
  61. check="true";
  62. }
  63. break;
  64. }
  65. else if(two[i]>one[i])
  66. {
  67. if(sign=="!=")
  68. {
  69. check="true";
  70. }
  71. else if(sign=="<")
  72. {
  73. check="true";
  74. }
  75. else if(sign=="<=")
  76. {
  77. check="true";
  78. }
  79. break;
  80. }
  81. else if(i==one.size()-1)
  82. {
  83. if(one[i]==two[i])
  84. {
  85. if(sign=="==")
  86. {
  87. check="true";
  88. }
  89. else if(sign=="<=")
  90. {
  91. check="true";
  92. }
  93. else if(sign==">=")
  94. {
  95. check="true";
  96. }
  97. }
  98. }
  99. }
  100. if(check=="true")
  101. {
  102. cout<<"TAK";
  103. }
  104. else if(check=="false")
  105. {
  106. cout<<"NIE";
  107. }
  108. }
  109. }
Success #stdin #stdout 0s 16064KB
stdin
4343 <= 4342
stdout
NIE