an class="n">sort</span><span class="p">()</span></code> where <code class="language-c++ highlighter-rouge"><span class="n">vec</span></code> is the name of your vector), and you can print a vector using the <code class="language-c++ highlighter-rouge"><span class="o">&lt;&lt;</span></code> operator, e.g. <code class="language-c++ highlighter-rouge"><span class="n">cout</span> <span class="o">&lt;&lt;</span> <span class="n">vec</span> <span class="o">&lt;&lt;</span> <span class="n">endl</span><span class="p