Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int n, m, minim = 10000000000, x, y;
- cin >> n >> m;
- x = 0; y = 0;
- int **a = new int*[n];
- for (int i = 0; i < n; i++) {
- a[i] = new int[m];
- }
- for (int i = 0; i < n; i++) {
- for (int j = 0; j < m; j++) {
- cin >> a[i][j];
- if (a[i][j] < minim) {
- minim = a[i][j];
- x = i;
- y = j;
- }
- }
- }
- for (int i = 0; i < n; i++) {
- for (int j = y; j < m; j++) {
- a[i][j] = a[i][j + 1];
- }
- }
- m--;
- for (int i = x; i < n; i++) {
- a[i] = a[i + 1];
- }
- n--;
- for (int i = 0; i < n; i++) {
- for (int j = 0; j < m; j++) {
- cout << a[i][j] << " ";
- }
- cout << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement