Advertisement
Josif_tepe

Untitled

Feb 18th, 2021
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.35 KB | None | 0 0
  1. #include <iostream>
  2. #include <algorithm>
  3. #include <cmath>
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.     int n;
  9.     cin >> n;
  10.     int mat[n][n];
  11.     for(int i = 0; i < n; i++) {
  12.         for(int j = 0; j < n; j++) {
  13.             cin >> mat[i][j];
  14.         }
  15.     }
  16.     for(int i = 0; i < n; i++) {
  17.         cout << mat[i][i] << " ";
  18.     }
  19.     return 0;
  20. }
  21.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement