title: Writing a sequence of numbers like: 1 22 333 4444 55555
body: <p>Okay so, I have to write a c++ program that reads a number and then proceeds to write every number up until the number that we read the same amount of times as its value. I have absolutely no idea how to explain this or what to search for so I'm hoping you understand what I need and can help me.</p>
  
  <p>Basically, if we cin >> 5, the output should be <code>1 22 333 4444 55555</code>. I have a feeling this is extremely easy but nothing crosses my mind right now. I tried with 2 for statements but I can't seem to get it right.</p>
  
  <p>This is my attempt:</p>
  
  <pre><code>int main () 
  { 
     int i,j,n;
     cout&lt;&lt;"n=";cin&gt;&gt;n;
     for (i=n;i&gt;=1;i--) 
     { 
        for (j=1;j&lt;=i;j++) 
        { 
           cout &lt;&lt; i; 
        } 
        cout&lt;&lt;" ";
     } 
  }
  </code></pre>