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