一个神奇的错误
#include<bits/stdc++.h>
using namespace std;
struct node{
int s[109];
}a[10007];
int x[10007];
bool cmp(int a, int b){
return 1;
}
int main(){
sort(x+1, x+1+17, cmp);
return 0;
}
如果这样写,调试会报错,但如果把上面的return 1改为return 0就对了?
#include<bits/stdc++.h>
using namespace std;
struct node{
int s[109];
}a[10007];
int x[10007];
bool cmp(int a, int b){
return 1==1;
}
int main(){
sort(x+1, x+1+17, cmp);
return 0;
}