fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. const int height = 6;
  6. const int width = 10;
  7. int s = 0;
  8. for (int i = 0; i < height; i++) {
  9. int c = s;
  10. for (int j = 0; j < width; j++) {
  11. cout << c;
  12. c = 1- c;
  13. }
  14. cout << '\n';
  15. s = 1 - s;
  16. }
  17.  
  18. return 0;
  19. }
Success #stdin #stdout 0s 15240KB
stdin
Standard input is empty
stdout
0101010101
1010101010
0101010101
1010101010
0101010101
1010101010