title: How to print this pyramid pattern?
body: <p>I am new to java. I have no idea how to print this pyramid pattern...</p>
  
  <p>This is my attempt:</p>
  
  <pre><code>for (int i=0;i&lt;=input;i++) {
     for (int j=1;j&lt;=i;j++) {
         System.out.print("x");
     }
     System.out.println();
  }
  </code></pre>
  
  <p>The expected output when the input = 8:</p>
  
  <pre><code>       x
        xox
       xoxox
      xoxoxox
     xoxoxoxox
    xoxoxoxoxox
   xoxoxoxoxoxox
  xoxoxoxoxoxoxox
  </code></pre>