Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- int n;
- void del(int** a, int row, int cow)
- {
- for (int i = row; i + 1 < n; ++i)
- for (int j = 0; j < n; ++j)
- a[i][j] = a[i + 1][j];
- for (int j = cow; j + 1 < n; ++j)
- for (int i = 0; i < n; ++i)
- a[i][j] = a[i][j + 1];
- n--;
- }
- int main()
- {
- cin >> n;
- int** a = new int* [n];
- for (int i = 0; i < n; ++i)
- a[i] = new int[n];
- for (int i = 0; i < n; ++i)
- for (int j = 0; j < n; ++j)
- cin >> a[i][j];
- int k, j;
- bool fl = true;
- cin >> k >> j;
- k--, j--;
- for (int i = 0; i < n; ++i)
- if (a[k][i] != a[i][j])
- {
- fl = false;
- break;
- }
- if (fl)
- del(a, k, j);
- for (int i = 0; i < n; ++i)
- {
- for (int j = 0; j < n; ++j)
- cout << a[i][j] << ' ';
- cout << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement