fork(1) download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6. int A[7][8];
  7. int sum = 0;
  8.  
  9. for (int i = 0; i < 7; i++)
  10. {
  11. for (int j = 0; j < 8; j++)
  12. {
  13. *(*(A + i) + j) = rand() % 100;
  14. printf("%2d ", *(*(A + i) + j));
  15. if (i + j == 10)
  16. sum += *(*(A + i) + j);
  17. }
  18. printf("\n");
  19. }
  20. printf("\n");
  21. printf("\n");
  22.  
  23. for (int i = 0; i < 7; i++)
  24. {
  25. for (int j = 0; j < 8; j++)
  26. {
  27. printf("%2d ", A[i][j]);
  28. }
  29. printf("\n");
  30. }
  31.  
  32. printf("\n");
  33. printf("%d", sum);
  34. }
  35.  
Success #stdin #stdout 0s 4296KB
stdin
Standard input is empty
stdout
83 86 77 15 93 35 86 92 
49 21 62 27 90 59 63 26 
40 26 72 36 11 68 67 29 
82 30 62 23 67 35 29  2 
22 58 69 67 93 56 11 42 
29 73 21 19 84 37 98 24 
15 70 13 26 91 80 56 73 


83 86 77 15 93 35 86 92 
49 21 62 27 90 59 63 26 
40 26 72 36 11 68 67 29 
82 30 62 23 67 35 29  2 
22 58 69 67 93 56 11 42 
29 73 21 19 84 37 98 24 
15 70 13 26 91 80 56 73 

141