title: Find unique numbers in array
body: <p>Well, I have to find how many different numbers are in an array.</p>
  
  <p>For example if array is: 1 9 4 5 8 3 1 3 5</p>
  
  <p>The output should be 6, because 1,9,4,5,8,3 are unique and 1,3,5 are repeating (not unique).</p>
  
  <p>So, here is my code so far..... not working properly thought.</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  using namespace std;
  
  int main() {
      int r = 0, a[50], n;
      cin &gt;&gt; n;
      for (int i = 0; i &lt; n; i++) {
          cin &gt;&gt; a[i];
      }
      for (int j = 0; j &lt; n; j++) {
          for (int k = 0; k &lt; j; k++) {
              if (a[k] != a[j]) r++;
          }
      }
      cout &lt;&lt; r &lt;&lt; endl;
      return 0;
  }
  </code></pre>