fork download
  1. #include <stdio.h>
  2.  
  3.  
  4. void printRow(int len, int row[]) {
  5. int i =0;
  6. for (i = 0; i < len; i++) {
  7. printf("%d\t", row[i]);
  8. }
  9. }
  10.  
  11. int main(void) {
  12. int m1[3][3] = {{1,2,3}, {4,5,6}, {7, 8, 9}};
  13. int m2[3][3] = {{7, 8, 9}, {4,5,6}, {1,2,3}};
  14. int i = 0;
  15. int width = 3; //3x3
  16.  
  17. for (i = 0; i < width; i++) {
  18. printf("|\t");
  19. printRow(width, m1[i]);
  20. printf("\t+\t");
  21. printRow(width, m2[i]);
  22. printf("\t|\n");
  23. }
  24.  
  25. // your code goes here
  26. return 0;
  27. }
  28.  
Success #stdin #stdout 0s 2052KB
stdin
Standard input is empty
stdout
|	1	2	3		+	7	8	9		|
|	4	5	6		+	4	5	6		|
|	7	8	9		+	1	2	3		|