fork(1) download
  1. #include <stdio.h>
  2. int main ()
  3. {
  4. int i, j, original = 0, linha, coluna, aux, N = 10, l, aux2, c, t;
  5. int mat[N][N];
  6.  
  7. for(i=0; i<N; i++)
  8. {
  9. for(j=0; j<N; j++)
  10. {
  11. mat[i][j] = original;
  12. original++;
  13. }
  14. }
  15.  
  16. for(i=0; i<N; i++)
  17. {
  18. for(j=0; j<N; j++)
  19. {
  20. printf("%d ", mat[i][j]);
  21. }
  22. printf("\n");
  23. }
  24.  
  25.  
  26. printf("\n");
  27. printf("\n");
  28. printf("\n");
  29. printf("\n");
  30.  
  31.  
  32. for(l=0; l<N; l++)
  33. {
  34. for(c=0; c<N; c++)
  35. {
  36. t = mat[l][c];
  37. mat[l][c] = mat[c][N-l-1];
  38. mat[c][N-l-1] = mat[N-l-1][N-c-1];
  39. mat[N-l-1][N-c-1] = mat[N-c-1][l];
  40. mat[N-c-1][l] = t;
  41. }
  42. }
  43.  
  44. for(i=0; i<N; i++)
  45. {
  46. for(j=0; j<N; j++)
  47. {
  48. printf("%d ", mat[i][j]);
  49. }
  50. printf("\n");
  51. }
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58. }
  59.  
  60.  
Success #stdin #stdout 0s 2160KB
stdin
Standard input is empty
stdout
0 1 2 3 4 5 6 7 8 9 
10 11 12 13 14 15 16 17 18 19 
20 21 22 23 24 25 26 27 28 29 
30 31 32 33 34 35 36 37 38 39 
40 41 42 43 44 45 46 47 48 49 
50 51 52 53 54 55 56 57 58 59 
60 61 62 63 64 65 66 67 68 69 
70 71 72 73 74 75 76 77 78 79 
80 81 82 83 84 85 86 87 88 89 
90 91 92 93 94 95 96 97 98 99 




0 1 2 3 4 5 6 7 8 9 
10 11 12 13 14 15 16 17 18 19 
20 21 22 23 24 25 26 27 28 29 
30 31 32 33 34 35 36 37 38 39 
40 41 42 43 44 45 46 47 48 49 
50 51 52 53 54 55 56 57 58 59 
60 61 62 63 64 65 66 67 68 69 
70 71 72 73 74 75 76 77 78 79 
80 81 82 83 84 85 86 87 88 89 
90 91 92 93 94 95 96 97 98 99