fork download
  1. #include<cstdio>
  2. #include<iostream>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int w, h;
  8.  
  9. scanf("%d %d", &w, &h);
  10.  
  11. char shop[h][w];
  12. for(int i=0; i<h; i++)
  13. for(int j=0; j<w; j++)
  14. cin>>shop[i][j];
  15.  
  16. for(int i=0; i<h; i++)
  17. {
  18. for(int j=0; j<w; j++)
  19. cout<<shop[i][j];
  20. cout<<"\n";
  21. }
  22.  
  23. return 0;
  24. }
Success #stdin #stdout 0s 3472KB
stdin
4 3
X1S3
42X4
X1D2
stdout
X1S3
42X4
X1D2