Advertisement
erfanul007

Timus 1313

Nov 3rd, 2018
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4. int a[110][110],t,i,j,c;
  5. scanf("%d",&t);
  6. for(i=1;i<=t;i++){
  7. for(j=1;j<=t;j++)
  8. scanf("%d",&a[i][j]);
  9. }
  10. for(c=1;c<=t;c++){
  11. i=c;
  12. j=1;
  13. while(1){
  14. printf("%d ",a[i][j]);
  15. i--;
  16. j++;
  17. if(i<1)
  18. break;
  19. }
  20. }
  21. for(c=1;c<t;c++){
  22. i=t;
  23. j=c+1;
  24. while(1){
  25. printf("%d ",a[i][j]);
  26. i--;
  27. j++;
  28. if(j>t)
  29. break;
  30. }
  31. }
  32. return 0;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement