SHARE
TWEET

Untitled

a guest Jan 17th, 2020 81 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6.     int a[2][2] = { 4, 5, 1, 3 };
  7.     for (int i = 0; i < 2-1; i++)
  8.     {
  9.         for (int j = 0; j < 2-1; j++)
  10.         {
  11.             if ((i == j) && (a[i][j] > a[i + 1][j + 1]))
  12.                 swap(a[i][j], a[i + 1][j + 1]);
  13.         }
  14.     }
  15.  
  16.     for (int i = 0; i < 2; i++)
  17.     {
  18.         for (int j = 0; j < 2; j++)
  19.         {
  20.             cout << a[i][j];
  21.         }
  22.         cout << endl;
  23.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top