Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int a[25][25], n, m, i, j, x;
- int main()
- { cin>>n;
- for (i=1;i<=n;i++)
- for (j=1;j<=n;j++)
- if (i<j && i+j<n+1)
- a[i][j]=1;
- else
- if (i>j && i+j>n+1)
- a[i][j]=2;
- else
- if (i!=j && i+j!=n+1)
- a[i][j]=3;
- for (i=1;i<=n;i++)
- {
- for (j=1;j<=n;j++)
- cout << a[i][j]<<' ';
- cout<< endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement