社区讨论

关于字符串比较的猎奇bug,求解答

学术版参与者 7已保存回复 8

讨论操作

快速查看讨论及其快照的属性,并进行相关操作。

当前回复
8 条
当前快照
1 份
快照标识符
@mi7esamm
此快照首次捕获于
2025/11/20 20:29
3 个月前
此快照最后确认于
2025/11/20 23:58
3 个月前
查看原帖
CPP
#include<iostream>
using namespace std;
int main(){
	bool f1="a">"b";
	//bool f2="b"<"a";
	cout<<f1;
	return 0;
} 
输出为0
CPP
#include<iostream>
using namespace std;
int main(){
	//bool f1="a">"b";
	bool f2="b"<"a";
	cout<<f2;
	return 0;
} 
输出为1
CPP
#include<iostream>
using namespace std;
int main(){
	bool f1="a">"b";
	bool f2="b"<"a";
	cout<<f1<<f2;
	return 0;
} 
输出为00
何意味?

回复

8 条回复,欢迎继续交流。

正在加载回复...