The easiest (but not the most efficient) method is to iterate through the array, checking to see if the number is present. If so, don't add it. You can write a function for this:
bool isValueInArray(int value, int *array, int numValues)
{
for(int x=0; x<numValues; ++x)
if(array[x] == value)
return true;
return false;
}
Now, when you get the number from the user, just call this function first in the body of your 'get input from user' loop, and only add it if it returns false:
if(isValueInArray(n, list, idx)
{
list[idx] = n;
++idx;
}
Semantically identical to the above, by using postfix increment:
if(isValueInArray(n, list, idx)
list[idx++] = n;
Of course, you don't need to write a separate function for this; I did it only for clarity. You can merge it into the loop with a flag variable and a nested loop.
You're also not printing out all the valid values the user entered, unless this happens to be 10. Try making your printing loop like so:
for(int j=0; j<idx; ++j)
cout << list[j] << ' ';
On another note, your code would be much clearer with consistent indentation, and (in my opinion, though I'm sure others will disagree) using the 'opening brace at line start' style, rather than the old K&R style. I had to scan your code a bit to tell where blocks began and ended, whereas if it were done the way I suggest, it'd have been much easier.