C++ STL partial_sort

2020-12-13 01:49

阅读:298

标签:==   turn   str   pause   ace   bsp   shuff   push   random   

#include
#include
#include
#include

using namespace std;

int main()
{
  deque deq1;
  deque::iterator deq_iter1;

  for (int k=0;k  {
    deq1.push_back(rand());
  }

  for (deq_iter1 = deq1.begin();deq_iter1 != deq1.end();++deq_iter1)
  {
    cout   }
  cout   cout

  partial_sort(deq1.begin(), deq1.begin() + 5, deq1.end());

  for (deq_iter1 = deq1.begin(); deq_iter1 != deq1.end(); ++deq_iter1)
  {
    cout   }
  cout   cout

  //random_shuffle(deq1.begin(), deq1.end());

 

  system("pause");
  return 0;
}

==========================================================

41 18467 6334 26500 19169 15724 11478 29358 26962 24464 5705 28145 23281 16827 9961
----------------------------------
41 5705 6334 9961 11478 26500 19169 29358 26962 24464 18467 28145 23281 16827 15724
----------------------------------
请按任意键继续. . .

 

C++ STL partial_sort

标签:==   turn   str   pause   ace   bsp   shuff   push   random   

原文地址:https://www.cnblogs.com/herd/p/11012716.html


评论


亲,登录后才可以留言!