title: need to reduce numbers similar an array (c ++)
body: <p>there are sorted in descending order of an array, it is necessary that two identical elements disappear, and instead enter a single 1 more 
  like this:
  [12 8 8 6 4 3 3] => [12 9 6 5 ]</p>
  
  <p>I tried to like this but goes completely nonsense:</p>
  
  <pre><code>vector&lt;int&gt; v(c, c + mn);
  
  for ( i = 0; i &lt; mn; i++)
  {
      if (v[i] == v[i + 1])
      {
          v[i]++;
          v.erase(v.begin() + i + 1);
          i = 0;
      }
      for (auto&amp;x : v)std::cout &lt;&lt; x &lt;&lt; ".";
  }
  </code></pre>
  
  <p>P.S.:sorry for bad english</p>