This sounds like a homework assignment to me, so I'm not sure if you'd be allowed to do this, but it would be really easy with sets. Sets are a type of data structure which are always ordered and can only store unique values, which sounds like what you're looking for. There's a set class in the STL.
To initialise a set:
To put stuff in:
Don't worry about putting stuff in twice - it'll just ignore the duplicates.
And to get stuff out:
for (set<int>::iterator i = list.begin(); i != list.end(); i++) {
cout << *i << " ";
}