fork download
  1. #include <iostream>
  2. #include <vector>
  3. using namespace std;
  4.  
  5. int main() {
  6.  
  7. const int j=3;
  8. vector<vector<int>> arr(5, vector<int>(j, 0));
  9.  
  10. int dx = 0;
  11. for (int g = 0; g < j; g++) {
  12. for (int t = 0; t < 5; t++) {
  13. arr[t][g]=1;
  14. }
  15. dx=g;
  16.  
  17. for (int d = 0; d <5; d++) {
  18. for (int n = 0; n < j; n++) {
  19. cout << arr[d][n] << " ";
  20. }
  21. cout << endl;
  22. }
  23. cout << endl;
  24. }
  25. return 0;
  26. }
Success #stdin #stdout 0s 15240KB
stdin
Standard input is empty
stdout
1 0 0 
1 0 0 
1 0 0 
1 0 0 
1 0 0 

1 1 0 
1 1 0 
1 1 0 
1 1 0 
1 1 0 

1 1 1 
1 1 1 
1 1 1 
1 1 1 
1 1 1