fork download
  1. #include <stdio.h>
  2.  
  3. int main(void)
  4. {
  5. int width;
  6. int height;
  7.  
  8. scanf("%d %d",&width,&height);
  9.  
  10. int array[height][width];
  11.  
  12. for (int i=0;i<height;i++){
  13. for (int j=0;j<width;j++){
  14. scanf("%d",&array[i][j]);
  15. }
  16. }
  17.  
  18. printf("----------------\n");
  19.  
  20. for (int i=0;i<height;i++){
  21. for (int j=0;j<width;j++){
  22. printf("%d ", array[i][j]);
  23. }
  24. printf("\n");
  25. }
  26.  
  27.  
  28. }
Success #stdin #stdout 0s 4316KB
stdin
6 3
1 3 5 7 9 1
2 4 6 8 0 2
3 4 2 0 1 3
stdout
----------------
1 3 5 7 9 1 
2 4 6 8 0 2 
3 4 2 0 1 3