一个神奇的错误:
#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 0;
}
int main(){
sort(x+1, x+1+17, cmp);
return 0;
}