title: Upside-down triangle of numbers
body: <p>I'm a beginner to Java and can't figure out how to print an upside down triangle of numbers. The numbers should decrease in value by 1 for each row. Ex. Number of rows: <code>6</code>;</p>
  <p>Print:</p>
  <pre><code>666666
  55555
  4444
  333
  22
  1
  </code></pre>
  <p>So far this is what I came up with; (<code>int nr</code> is scanned input from user)</p>
  <pre class="lang-java prettyprint-override"><code>for (int i = 1; i &lt;= nr; i++) {
      for (int j = 1; j &lt;= nr; j++) {
          System.out.print(nr);
      }
      nr--;
      System.out.println();
  }
  </code></pre>
  <p>By having <code>nr--;</code> the loop gets shorter and I cant figure out how to keep the loop going for <code>nr</code>-times, yet still decreasing the amount of numbers printed out.</p>