代码:

#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
using namespace std;

int main()
{
    int a[] = {1,4,3,3,2,2,5,7,5,6};
    sort(a, a + sizeof(a) / sizeof(int));
    for (auto it = a; it != a + sizeof(a) / sizeof(int); it++)
    {
        cout << *it << " ";
    }
    cout << endl;
    system("pause");
    return 0;
    return 0;
}

运行结果:

c++中sort()函数的用法简介

相关文章:

  • 2021-11-21
  • 2021-11-21
  • 2021-11-21
  • 2022-12-23
  • 2021-11-21
  • 2021-11-21
  • 2021-11-21
猜你喜欢
  • 2021-11-25
  • 2021-11-21
  • 2021-11-21
  • 2021-12-01
  • 2021-11-21
  • 2021-11-21
  • 2021-11-21
相关资源
相似解决方案