玄关
  • 板块灌水区
  • 楼主wowwowwow
  • 当前回复0
  • 已保存回复0
  • 发布时间2024/4/6 21:15
  • 上次更新2024/4/6 21:15:23
查看原帖
玄关
373938
wowwowwow楼主2024/4/6 21:15

一个神奇的错误

#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;
}
2024/4/6 21:15
加载中...