Advertisement
Guest User

Untitled

a guest
Jan 21st, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.40 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4. string l1,l2,z,s="2134 == 2134";
  5. int main()
  6. {
  7.  
  8. long long czy=0 ,x,x2,c,zn=0,l2n=0,n=0;
  9.  
  10. cin >>l1;
  11. cin >> z;
  12. cin >> l2;
  13. x2=l1.length();
  14.  
  15.  
  16. if(z=="==")
  17. {
  18. if (l1==l2)
  19. {
  20. cout<<"TAK";
  21.  
  22. }else
  23. cout<<"NIE";
  24. }
  25. if(z=="!=")
  26. {
  27. if(l1==l2)
  28. {
  29. cout<<"NIE";
  30.  
  31. }else
  32. {
  33.  
  34.  
  35. cout<<"TAK";
  36. }
  37. }
  38. if(z=="<")
  39. {
  40. if (l1.length()<l2.length())
  41. {
  42. cout<<"TAK";
  43.  
  44. } else
  45. {
  46. if (l1.length()==l2.length()&&l1!=l2)
  47. {
  48. for(c=0;c<x2;c++)
  49. {
  50.  
  51. if (l1[c]<l2[c])
  52. {
  53. cout<<"TAK";
  54. czy=1;
  55. break;
  56. }
  57. }
  58. if (czy!=1)
  59. {
  60.  
  61. cout<<"NIE";
  62. }
  63. }else {
  64. cout<< "NIE";
  65. }
  66. }
  67. }
  68. if(z==">")
  69. {
  70. if (l1.length()>l2.length())
  71. {
  72.  
  73. } else
  74. {
  75. if (x2==l2.length()&&l1!=l2)
  76. {
  77. for(c=0;c<x2;c++)
  78. {
  79. if (l1[c]>l2[c])
  80. {
  81. cout<<"TAK";
  82. czy=1;
  83. break;
  84. }
  85. }
  86. if (czy!=1)
  87. cout<<"NIE";
  88.  
  89. }else {
  90. cout <<"NIE";
  91. }
  92. }
  93. }
  94. if(z=="<=")
  95. {
  96.  
  97. if (l1.length()<l2.length()||l1==l2)
  98. {
  99. cout<<"TAK";
  100.  
  101. } else
  102. {
  103.  
  104. if (l1.length()==l2.length())
  105. {
  106. for(c=0;c<x2+1;c++)
  107. {
  108. if (l1[c]<l2[c])
  109. {
  110. cout<<"TAK";
  111.  
  112. break;
  113. }else {
  114. if (l1[c]>l2[c])
  115. {
  116. cout << "NIE";
  117. break;
  118. }
  119. }
  120. if (c=x2)
  121. {
  122. cout <<"TAK";
  123. break;
  124. }
  125. }
  126.  
  127.  
  128. }else{
  129. cout <<"NIE";
  130. }
  131. }
  132. }
  133. if(z==">=")
  134. {
  135. if (l1.length()>l2.length()||l1==l2)
  136. {
  137. cout<<"TAK";
  138. } else
  139. {
  140. if (l1.length()==l2.length())
  141. {
  142. for(c=0;c<x2;c++)
  143. {
  144. if (l1[c]>l2[c])
  145. {
  146. cout<<"TAK";
  147. czy=1;
  148. break;
  149. }
  150. }
  151. if(czy!=1)
  152. cout<<"NIE";
  153.  
  154. } else{
  155. cout <<"NIE";
  156. }
  157. }
  158. }
  159.  
  160. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement