用标准库中的排序算法给list排序不行吗?
#include<list>
#include<algorithm>
#include<stdlib.h>
#include<iostream>
using namespace std;
int main()
{
list<int> l2;
for(int j=0;j<20;j++)
l2.push_front(j);
sort(l2.begin(),l2.end());
system("pause");
return 0;
}
上面一段简短的代码为啥编译不通过啊?
[解决办法]