Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int main() {
- int n;
- cin >> n;
- vector<vector<int>> a(n, vector<int>(n, 0));
- for (int i = 0; i < n; i++) {
- a[i][i] = 1;
- a[i][n - 1 - i] = 1;
- }
- for (int i = 0; i < n; i++) {
- for (int j = 0; j < n; j++) {
- cout << a[i][j] << " ";
- }
- cout << '\n';
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment