Nusrat_Ullah

timus 1313

Oct 25th, 2018
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.39 KB | None | 0 0
  1. #include<iostream>
  2. #include<vector>
  3. #include<algorithm>
  4. using namespace std;
  5. int main()
  6. {
  7.     int a,b,i,j;
  8.     scanf("%d",&a);
  9.     int ax[a+3][a+3];
  10.     for(i=0;i<a;i++) for(j=0;j<a;j++) scanf("%d",&ax[i][j]);
  11.     for(i=0;i<a;i++) for(b=i,j=0;j<=i;j++,b--) printf("%d ",ax[b][j]);
  12.     for(i=1;i<a;i++) for(b=a-1,j=i;j<a;j++,b--) printf("%d ",ax[b][j]);
  13.     printf("\n");
  14.     return 0;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment