#include <iostream>
int main() {
int square_size = 7;
/*
We print an n×n square.
- If the cell is on the border (top, bottom, left, right),
we print 1.
- Otherwise, we print 0.
*/
for (int i = 0; i < square_size; i++) { // Loop through rows
for (int j = 0; j < square_size; j++) { // Loop through columns
// Check if the cell is on any of the four sides
if (i == 0 || i == square_size - 1 || j == 0 || j == square_size - 1) {
std::cout << 1 << " ";
} else {
std::cout << 0 << " ";
}
}
std::cout << std::endl;
}
}
/*
run:
1 1 1 1 1 1 1
1 0 0 0 0 0 1
1 0 0 0 0 0 1
1 0 0 0 0 0 1
1 0 0 0 0 0 1
1 0 0 0 0 0 1
1 1 1 1 1 1 1
*/