K12教育赛事综合服务平台
聚乐之家官方网站
下载聚乐之家官方App
专注青少年竞赛题库网站
#include <iostream> #include <algorithm> using namespace std; bool cmp(int a, int b) { return a > b; } int main() { int arr[] = {3,1,4,2,5}; sort(arr, arr+5, cmp); return 0; }
{5, 4, 3, 2, 1}
{1, 2, 3, 4, 5}
{3, 1, 4, 2, 5}
代码编译报错,无法运行