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