Quick actions

cmd+k|ctrl+k

Navigation

Languages

lab7(938)

Snippet info

Language

Cpp

Visibility

public

Author

bikhnevichk

Created

2018-12-11T19:55:33Z

Updated

2018-12-11T19:55:33Z

#include <iostream>
using namespace std;

int main()
{
      const int size = 4;
      int arr[size][size];
      for (int i = 0; i < size; i++)
            for (int j = 0; j < size; j++)
            {
                  cout<<"a["<<i<<"]["<<j<<"]"<<endl;
                  cin>>arr[i][j];
            }
        int index = 0;
      cout<<"Enter index:"<<endl;
      cin>>index;
      if (index > -1 && index < size) 
            cout<<"Элемент побочной диагонали : "<<arr[size - index - 1][index];
      else cout<<"Индекс введен неверно!";
            
      return 0;
}
INFO