SHARE
TWEET

Untitled

a guest Feb 27th, 2020 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int array2D[3][3];
  8.     int newArray2D[3][3];
  9.     for(int i=0 ; i<3 ; i++)
  10.     {
  11.         for(int j=0 ; j<3 ; j++)
  12.         {
  13.             cout<<"a["<<i<<"]["<<j<<"] = ";
  14.             cin>>array2D[i][j];
  15.         }
  16.     }
  17.  
  18.     for(int i=0 ; i<3 ; i++)
  19.     {
  20.         for(int j=0 ; j<3 ; j++)
  21.         {
  22.             newArray2D[i][j] = array2D[i][j];
  23.         }
  24.     }
  25.  
  26.     for(int i=0 ; i<3 ; i++)
  27.     {
  28.         for(int j=0 ; j<3 ; j++)
  29.         {
  30.             array2D[i][j] = newArray2D[3-j-1][i];
  31.         }
  32.     }
  33.     for(int i=0 ; i<3 ; i++)
  34.     {
  35.         for(int j=0 ; j<3 ; j++)
  36.         {
  37.             cout<<array2D[i][j]<<" ";
  38.         }
  39.     }
  40. }
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