Advertisement
NOBLE-_-MAN

Коробки С++

Nov 16th, 2020
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.72 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4.  
  5. int main() {
  6.   int a, b, c, a2, b2, c2;
  7.   cin >> a >> b >> c >> a2 >> b2 >> c2;
  8.  
  9.   if (a<=b){
  10.     swap(a,b);
  11.   }
  12.   if (a<=c){
  13.     swap(a,c);
  14.   }
  15.   if (b<=c){
  16.     swap(b,c);
  17.   }
  18.  
  19.   if (a2<=b2){
  20.     swap(a2,b2);
  21.   }
  22.   if (a2<=c2){
  23.     swap(a2,c2);
  24.   }
  25.   if (b2<=c2){
  26.     swap(b2,c2);
  27.   }
  28.  
  29.   if (a-a2==0 and b-b2==0 and c-c2==0){
  30.     cout << "Boxes are equal";
  31.   }
  32.   else if (a-a2>=0 and b-b2>=0 and c-c2>=0){
  33.     cout << "The first box is larger than the second one";
  34.   }
  35.   else if (a-a2<=0 and b-b2<=0 and c-c2<=0){
  36.     cout << "The first box is smaller than the second one";
  37.   }
  38.   else {
  39.         cout << "Boxes are incomparable";
  40.   }
  41.   return 0;
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement