title: How to conveniently align numbers centrally in C++ cout
body: <p>I have the following matrix stored in a int[][] in c++ (sorry that I did not put all the commas in):</p>
  
  <pre><code>int[8][]a={
     1    2    3    4    5    6    7    8 
    28   29   30   31   32   33   34    9 
    27   48   49   50   51   52   35   10 
    26   47   60   61   62   53   36   11 
    25   46   59   64   63   54   37   12 
    24   45   58   57   56   55   38   13 
    23   44   43   42   41   40   39   14 
    22   21   20   19   18   17   16   15};
  </code></pre>
  
  <p>And I need to print it out with single digits align nicely with the rest. How to do this conveniently? I've already used <code>setw</code>, but it seems it only causes the output to be right-justified.</p>
  
  <p>Thank you.</p>
  
  <p><strong>Edit</strong></p>
  
  <p>Maybe I did not say this clearly. Sorry about that. I want the output to be something like:</p>
  
  <pre><code>   1    2    3    4    5    6    7    8 
    228  129  130  131   32   33   34    9 
  </code></pre>
  
  <p>Assuming I have more digits in the numbers.</p>