Advertisement
myloyo

6.6.13

Dec 10th, 2022 (edited)
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.67 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int n, m, minim = 10000000000, x, y;
  8.     cin >> n >> m;
  9.     x = 0; y = 0;
  10.     int **a = new int*[n];
  11.     for (int i = 0; i < n; i++) {
  12.         a[i] = new int[m];
  13.     }
  14.     for (int i = 0; i < n; i++) {
  15.         for (int j = 0; j < m; j++) {
  16.             cin >> a[i][j];
  17.             if (a[i][j] < minim) {
  18.                 minim = a[i][j];
  19.                 x = i;
  20.                 y = j;
  21.             }
  22.         }
  23.     }
  24.     for (int i = 0; i < n; i++) {
  25.         for (int j = y; j < m; j++) {
  26.             a[i][j] = a[i][j + 1];
  27.         }
  28.     }
  29.     m--;
  30.     for (int i = x; i < n; i++) {
  31.         a[i] = a[i + 1];
  32.     }
  33.     n--;
  34.     for (int i = 0; i < n; i++) {
  35.         for (int j = 0; j < m; j++) {
  36.             cout << a[i][j] << " ";
  37.         }
  38.         cout << endl;
  39.     }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement