如何用C++解决排序问题????
有整数序列{5,6,3,8,3,9,7,2,1,4,0},编程由大到小排序,打印排序后信息
结果是:9 8 7 6 5 4 3 2 1 0
谢谢~~~~
[解决办法]
#include <functional>
#include <algorithm>
using namespace std;
int main(int argc, char* argv[])
{
int sz[] = {5,6,3,8,3,9,7,2,1,4,0};
sort(sz,sz+sizeof(sz)/sizeof(sz[0]),greater <int> () );
return 0;
}