Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int main(){
- ios_base::sync_with_stdio(false);
- cin.tie(NULL);
- int n;
- while(cin >> n){
- for(int i = 0; i < n; i++){
- for(int j = 0; j < n; j++){
- if(i == j){
- if(n%2 == 1 && i == n/2){
- cout << "2";
- } else{
- cout << "1";
- }
- } else if(j == n-i-1){
- cout << "2";
- } else{
- cout << "3";
- }
- }
- cout << "\n";
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement