c++中自带的什么函数能给数组排序

发布时间:2024-05-17 14:22 发布:上海旅游网

问题描述:

问题解答:

#include <algorithm>
using namespace std;

int main() {
int a[] = { 8, 4, 5, 6, 8, 0, 11 };
sort(a, a + 7);
for (int i = 0; i < 7; ++i) {
cout << a[i] << " ";
}
cout << endl;
return 0;
}

qsort

stl:sort

热点新闻