TEXT   33
Untitled
Guest on 14th August 2022 05:14:08 PM


  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6.     int x1, x2, x3, y1, y2, y3, n1, n2, n3, min;
  7.     cin >> y1 >> y2 >> y3 >> n1 >> n2 >> n3;
  8.     if (y1 - n1 < 0 || y2 - n2 < 0 || y3 - n3 < 0)
  9.     {
  10.         cout << "Incorrect Input";
  11.     }
  12.     else
  13.     {
  14.         x1 = y1 - n1;
  15.         x2 = y2 - n2;
  16.         x3 = y3 - n3;
  17.         min = x1;
  18.         if (min > x2)
  19.         {
  20.             min = x2;
  21.         }
  22.         if (min > x3)
  23.         {
  24.             min = x3;
  25.         }
  26.         cout << min << endl;
  27.     }
  28. }

Raw Paste

Login or Register to edit or fork this paste. It's free.