Home > Back-end >  Why is unique function will appear such circumstance?
Why is unique function will appear such circumstance?

Time:09-19

As follows, I use the unique function, delete duplicate number is 8, but in the end turned into 10.,,
8,7,8,10,4,2,1 int a []={};
Vector V (a, a + 7);
Sort (what exactly do v.begin (), v.e nd ());
//int size=unique (what exactly do v.begin (), v.e nd ()) - what exactly do v.begin ();
//cout & lt; For (int t=0; T & lt; 7. T++)
{
Cout & lt; }


In a set or so:
8,7,8,10,2,2,2 int a []={};
Vector V (a, a + 7);
Sort (what exactly do v.begin (), v.e nd ());
//int size=unique (what exactly do v.begin (), v.e nd ()) - what exactly do v.begin ();
//cout & lt; For (int t=0; T & lt; 7. T++)
{
Cout & lt; }


Pray god give directions!!!!!!

CodePudding user response:

Vector constructor, sort function, unique function, ats function, the parameter is used to,

CodePudding user response:

You can not use VECTOR, direct use of array a sort and the unique function can
Specific content, we can see this article:
http://blog.csdn.net/tomorrowtodie/article/details/51907471

  • Related