Advertisement
Farjana_akter

some word about sports

Feb 17th, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3.  
  4.  
  5. int main()
  6. {
  7. int n,i,j,k,a[105][105],b,c,d,e,f;
  8. cin>>n;
  9. for(i=0;i<n;i++)
  10. {
  11. for(j=0;j<n;j++)
  12. cin>>a[i][j];
  13. }
  14. for(i=0;i<(2*n)-1;i++)
  15. {
  16. for(j=0;j<=i&&j<n;j++)
  17. {
  18. if(i-j>=0 && i-j<n)
  19. cout<<a[i-j][j]<<" ";
  20. }
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement