Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<vector>
- #include<algorithm>
- using namespace std;
- int main()
- {
- int a,b,i,j;
- scanf("%d",&a);
- int ax[a+3][a+3];
- for(i=0;i<a;i++) for(j=0;j<a;j++) scanf("%d",&ax[i][j]);
- for(i=0;i<a;i++) for(b=i,j=0;j<=i;j++,b--) printf("%d ",ax[b][j]);
- for(i=1;i<a;i++) for(b=a-1,j=i;j<a;j++,b--) printf("%d ",ax[b][j]);
- printf("\n");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment