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