Skip to content

Instantly share code, notes, and snippets.

@enzerr
Created January 31, 2023 00:05
Show Gist options
  • Save enzerr/29db7df3b1b59477c5f1156ed7f10926 to your computer and use it in GitHub Desktop.
Save enzerr/29db7df3b1b59477c5f1156ed7f10926 to your computer and use it in GitHub Desktop.
#include<bits/stdc++.h>
using namespace std;
const int maxn = 1e2 + 5;
int mtx[maxn][maxn];
int main(){
int n; cin >> n;
for(int k = 0; k < (n+1)/2; k++){
for(int i = k; i < n-k; i++){
for(int j = k; j < n-k; j++){
mtx[i][j]++;
}
}
}
for(int i = 0; i < n; i++){
for(int j = 0; j < n; j++){
cout << mtx[i][j];
}
cout << '\n';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment