Untitled
unknown
plain_text
3 years ago
367 B
3
Indexable
#include <iostream> using namespace std; int main() { int a,i,n,j; cin >> n; for (i = 0; i < n; i++) { j = 0; if (i == 0 || i == n - 1) { for (j = 0; j < n; j++) { cout << "1"; } } else { for (j = 0; j < n; j++) { if (j == 0 || j == n - 1) cout << "1"; else cout << "0"; } } cout << "\n"; } }
Editor is loading...