title: C++ Unique values in a vector?
body: <p>I have to create a program which asks the user to enter 20 numbers between 10 and 100 which will be stored in a vector, but only unique values will be stored. I have created a program which stores the values within the range, but I don't  know how to store only the unique values. Here is what I have:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;vector&gt;
  using namespace std;
  
  void print(vector&lt;int&gt;v);
  
  int main()
  {
      vector&lt;int&gt;v;
  
  
      int x;
      for (int num = 0; num &lt; 20; num++)
      {
          cout &lt;&lt; "Enter number " &lt;&lt; (num + 1) &lt;&lt; ":";
          cin &gt;&gt; x;
          if (10 &lt; x)
          {
              if (x &lt; 100)
  
                  v.push_back(x);
          }
      }
      print(v);
  
  
  }
  
  void print(vector&lt;int&gt;v2)
  {
      for (int count = 0; count &lt; v2.size(); count++)
      cout &lt;&lt; v2[count] &lt;&lt; " ";
  }
  </code></pre>
  
  <p>I'd like to thank everyone for their help.</p>