fork(11) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. const int size = 9;
  6.  
  7. for (int i = 0; i < size; i++) {
  8. for (int j = 0; j < size; j++) {
  9. char symbol = (j == i) || (j == size - i - 1) ? 'x' : ' ';
  10. cout << symbol;
  11. }
  12. cout << endl;
  13. }
  14.  
  15. return 0;
  16. }
Success #stdin #stdout 0s 3412KB
stdin
Standard input is empty
stdout
x       x
 x     x 
  x   x  
   x x   
    x    
   x x   
  x   x  
 x     x 
x       x