Advertisement
STANAANDREY

sesiune spec bac2022 2

May 31st, 2022
883
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.51 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int a[100][100], n;
  4.  
  5. int main() {
  6.     cin >> n;
  7.     for (int i = 0; i < n; i++) {
  8.         for (int j = 0; j < n; j++) {
  9.             cin >> a[i][j];
  10.         }
  11.     }
  12.  
  13.     for (int i = 0; i < n; i++) {
  14.         for (int j = i; j < n - 1; j++) {
  15.             a[i][j] = a[i][j + 1];
  16.         }
  17.     }
  18.  
  19.     for (int i = 0; i < n; i++) {
  20.         for (int j = 0; j < n - 1; j++) {
  21.             cout << a[i][j] << ' ';
  22.         }
  23.         cout << endl;
  24.     }
  25.     return 0;
  26. }
  27.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement