Skip to content

Instantly share code, notes, and snippets.

@vlaleli
Created October 30, 2024 20:01
Show Gist options
  • Select an option

  • Save vlaleli/2cf54cd2cee546d0b5d9e4f456860a79 to your computer and use it in GitHub Desktop.

Select an option

Save vlaleli/2cf54cd2cee546d0b5d9e4f456860a79 to your computer and use it in GitHub Desktop.
#include <iostream>
using namespace std;
int main() {
int n;
cout << "Enter size: ";
cin >> n;
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
if (i == n / 2 || j == n / 2) {
cout << "1 ";
} else {
cout << "0 ";
}
}
cout << endl;
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment