#include <iostream> #include <iomanip> #include <vector> using namespace std; int main() { int n; cin >> n; vector<vector<int>> matrix(n, vector<int>(n, 0)); for (int i = 0; i < n; ++i) { for (int j = 0; j < n; ++j) { // ?????????? if (i == 0 || i == n - 1 || j == 0 || j == n - 1) { matrix[i][j] = 1; } // ???????????? else if (i == j || i + j == n - 1) { matrix[i][j] = 1; } } } // ???? for (int i = 0; i < n; ++i) { for (int j = 0; j < n; ++j) { cout << setw(3) << matrix[i][j]; // ?????3?????? } cout << endl; // ????????? } return 0; } /************************************************************** Problem: 1327 User: wuhanyu Language: C++ Result: Wrong Answer ****************************************************************/