为什么cmp里面不能写小于等于
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<queue>
#include<stack>
#include<cstring>
#include<string>
#include<functional>
#include<map>
using namespace std;
int red() {
int op = 1, x = 0;
char ch = getchar();
while(!isdigit(ch)) {
if(ch == '-') {
op = -1;
}
ch = getchar();
}
while(isdigit(ch)) {
x = x * 10 + ch - '0';
ch = getchar();
}
return x * op;
}
int a[100];
bool cmp(int a, int b) {
return a <= b;
}
int main() {
for(int i = 1; i <= 20; ++i) {
a[i] = 1;
}
puts("--");
for(int i = 1; i <= 20; ++i) {
cout << a[i] << ' ' ;
}
puts("");
puts("--");
sort(a + 1, a + 21, cmp);
puts("--");
for(int i = 1; i <= 20; ++i) {
cout << a[i] << ' ' ;
}
puts("--");
return 0;
}