Compile Error

foo.cc: In function 'int main()':
foo.cc:7:9: error: no match for 'operator^' (operand types are 'std::basic_ostream<char>' and 'int')
    7 |  cout<<a^2;
      |  ~~~~~~~^~
      |      |   |
      |      |   int
      |      std::basic_ostream<char>
foo.cc:7:9: note: candidate: 'operator^(int, int)' <built-in>
    7 |  cout<<a^2;
      |  ~~~~~~~^~
foo.cc:7:9: note:   no known conversion for argument 1 from 'std::basic_ostream<char>' to 'int'
In file included from /usr/include/c++/9/ios:42,
                 from /usr/include/c++/9/ostream:38,
                 from /usr/include/c++/9/iostream:39,
                 from foo.cc:1:
/usr/include/c++/9/bits/ios_base.h:91:3: note: candidate: 'constexpr std::_Ios_Fmtflags std::operator^(std::_Ios_Fmtflags, std::_Ios_Fmtflags)'
   91 |   operator^(_Ios_Fmtflags __a, _Ios_Fmtflags __b)
      |   ^~~~~~~~
/usr/include/c++/9/bits/ios_base.h:91:27: note:   no known conversion for argument 1 from 'std::basic_ostream<char>' to 'std::_Ios_Fmtflags'
   91 |   operator^(_Ios_Fmtflags __a, _Ios_Fmtflags __b)
      |             ~~~~~~~~~~~~~~^~~
/usr/include/c++/9/bits/ios_base.h:133:3: note: candidate: 'constexpr std::_Ios_Openmode std::operator^(std::_Ios_Openmode, std::_Ios_Openmode)'
  133 |   operator^(_Ios_Openmode __a, _Ios_Openmode __b)
      |   ^~~~~~~~
/usr/include/c++/9/bits/ios_base.h:133:27: note:   no known conversion for argument 1 from 'std::basic_ostream<char>' to 'std::_Ios_Openmode'
  133 |   operator^(_Ios_Openmode __a, _Ios_Openmode __b)
      |             ~~~~~~~~~~~~~~^~~
/usr/include/c++/9/bits/ios_base.h:173:3: note: candidate: 'constexpr std::_Ios_Iostate std::operator^(std::_Ios_Iostate, std::_Ios_Iostate)'
  173 |   operator^(_Ios_Iostate __a, _Ios_Iostate __b)
      |   ^~~~~~~~
/usr/include/c++/9/bits/ios_base.h:173:26: note:   no known conversion for argument 1 from 'std::basic_ostream<char>' to 'std::_Ios_Iostate'
  173 |   operator^(_Ios_Iostate __a, _Ios_Iostate __b)
      |             ~~~~~~~~~~~~~^~~
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
P1002 求正方形的面积
语言
C++
递交时间
2022-07-07 15:23:13
评测时间
2022-07-07 15:23:13
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes