今天写c++,当我写出如下代码时,编译器报错了
#include<bits/stdc++.h>using namespace std;int main(){int a=1,b=3,c=2,d=6;// cout<<(a^b^c^d)<<endl;cout<<a^b^c^d<<endl;return 0;
}
D:\sublineText\demo\demo.cpp: In function 'int main()':
D:\sublineText\demo\demo.cpp:8:12: error: no match for 'operator^' (operand types are 'std::basic_ostream<char>' and 'int')
8 | cout<<a^b^c^d<<endl;
#include<bits/stdc++.h>using namespace std;int main(){int a=1,b=3,c=2,d=6;cout<<(a^b^c^d)<<endl;// cout<<a^b^c^d<<endl;return 0;
}
这样就对了,占个坑,现在不知道是怎么回事
文心一言的解释也很ex