Advertisement
owlachno

bombit (2)

Jan 25th, 2020
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.84 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int main()
  4. {
  5.     int A1, B1, C1, A2, B2, C2, tmp;
  6.     cin >> A1 >> B1 >> C1 >> A2 >> B2 >> C2;
  7.     if (A1 > B1) {tmp = A1; A1 = B1; B1 = tmp;}
  8.     if (A1 > C1) {tmp = A1; A1 = C1; C1 = tmp;}
  9.     if (B1 > C1) {tmp = B1; B1 = C1; C1 = tmp;}
  10.     if (A2 > B2) {tmp = A2; A2 = B2; B2 = tmp;}
  11.     if (A2 > C2) {tmp = A2; A2 = C2; C2 = tmp;}
  12.     if (B2 > C2) {tmp = B2; B2 = C2; C2 = tmp;}
  13.     if (A1 == A2 && B1 == B2 && C1 == C2)
  14.     {
  15.         cout << "Boxes are equal";
  16.     }
  17.     else if (A1 <= A2 && B1 <= B2 && C1 <= C2)
  18.     {
  19.         cout << "The first box is smaller than the second one";
  20.     }
  21.     else if (A1 >= A2 && B1 >= B2 && C1 >= C2)
  22.     {
  23.         cout << "The first box is larger than the second one";
  24.     }
  25.     else
  26.     {
  27.         cout << "Boxes are incomparable";
  28.     }
  29.     return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement