title: Printing out a specific number of digits based on the number with longest length?
body: <p>I'm looking to print out a number matrix using parallel arrays.
  I want to find a way to ensure that each number is printed out with a proper amount of digits, based on how long the longest digit number in the array is. </p>
  
  <p>So for example:</p>
  
  <pre><code>rows = r;
  cols = c;
  int[][] matrix = new int[rows][cols];
  
  for (int x = 0; x &lt; cols; x++)
  {
    for (int y = 0; y &lt; rows; y++)
    {
      matrix[x][y] = (x*y);
    }
  }
  </code></pre>
  
  <p>If I choose to set <code>cols = 101</code> and <code>rows = 101</code>, my largest number will be <code>10000</code>. How can I set this program up so that at <code>matrix[1][1] = (1*1)</code> my output will be <code>00001</code>, instead of just <code>1</code>?</p>