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