Laitofai

13

Apr 14th, 2019
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.84 KB | None | 0 0
  1. //13
  2. #include <iostream>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.     int n, sum, index = -1;
  9.     cin >> n;
  10.     int arr[n][n];
  11.     for(int i = 0; i < n; i++){
  12.         sum = 0;
  13.         for(int j = 0; j < n; j++){
  14.             cin >> arr[i][j];
  15.             sum += arr[i][j];
  16.         }
  17.  
  18.         if(sum > 20 && index == -1){
  19.             index = i;
  20.         }
  21.     }
  22.  
  23.     for(int i = 0; i < n; i++){ // номер столбца
  24.         for(int j = index; j < n - 1; j++){
  25.             arr[j][i] = arr[j + 1][i];
  26.         }
  27.     }
  28.  
  29.     cout << endl;
  30.     if(index == -1){
  31.         cout << "NET STROK SUMMOI BOLSHE 20!!!";
  32.         return 0;
  33.     }
  34.     for(int i = 0; i < n - 1; i++){ // номер строки
  35.         for(int j = 0; j < n; j ++){
  36.             cout << arr[i][j] << " ";
  37.         }
  38.         cout << endl;
  39.     }
  40.     return 0;
  41. }
Advertisement
Add Comment
Please, Sign In to add comment