fork download
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5. int a[][4] = {
  6. {3, 5, -1, 8},
  7. {2, 3, 2, 4},
  8. {4, 2, -5, 3},
  9. };
  10. int row, col, sum = 0;
  11.  
  12. for (row = 0; row < 3; row++) {
  13. for (col = 0; col < 4; col++) {
  14. sum += a[row][col];
  15. }
  16. }
  17. printf("%d\n", sum);
  18. return 0;
  19. }
  20.  
Success #stdin #stdout 0.02s 1676KB
stdin
Standard input is empty
stdout
30