bishalbiswas

URAL:1313

Jan 3rd, 2014
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4. int n,i,j,c,r;
  5. scanf("%d",&n);
  6.  
  7. int array[100][100];
  8.  
  9. for(i = 0;i<n;i++)
  10. for(j = 0;j<n;j++)
  11. scanf("%d",&array[i][j]);
  12.  
  13. for(i = 0;i<(2*n-1);i++){
  14. for(c = 0;c<=i&&c<n;c++){
  15. r = i-c;
  16. if(r>=0&&r<n)
  17. printf("%d ",array[r][c]);
  18. }
  19. }
  20.  
  21. return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment