fork(3) 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. scanf("%c", &shop[i][j]);
  15.  
  16. for(int i=0; i<h; i++)
  17. {
  18. for(int j=0; j<w; j++)
  19. printf("%c", shop[i][j]);
  20. //cout<<shop[i][j];
  21. printf("\n");
  22. //cout<<"\n";
  23. }
  24.  
  25. return 0;
  26. }
Success #stdin #stdout 0s 3472KB
stdin
4 3
X1S3
42X4
X1D2
stdout
X1S
3
42
X4
X