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