title: Floyd's triangle variation
body: <p>So I have to print Floyd's triangle but like this:</p>
  
  <pre><code>7
  
  1
  
  2 3
  
  4 5 6
  
  7 * * * 
  </code></pre>
  
  <p>Here is my code, I just can't figure out how to print the <code>*</code> at the end  of the last line if there is any space left. </p>
  
  <pre><code>#include&lt;iostream&gt;
  #include&lt;cmath&gt;
  using namespace std;
  int main ()
  {
    int n;
    cin&gt;&gt;n;
    int br=1;
  
    for (int i=1;i&lt;=n;i++)
    {
      for(int j=1;j&lt;=i;j++)
      {
        if(br&lt;=n)
          cout&lt;&lt;br&lt;&lt;" ";
        br++;
      }
      if(br&lt;=n)
        cout&lt;&lt;endl;
    }
  }    
  </code></pre>