Compile Error

/in/foo.cc: In function 'int main()':
/in/foo.cc:10:25: error: no match for 'operator=' (operand types are 'std::basic_ostream<char>' and 'int')
   10 |                 cout<<X=M;
      |                         ^
In file included from /usr/include/c++/12/iostream:39,
                 from /in/foo.cc:1:
/usr/include/c++/12/ostream:402:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator=(std::basic_ostream<_CharT, _Traits>&&) [with _CharT = char; _Traits = std::char_traits<char>]'
  402 |       operator=(basic_ostream&& __rhs)
      |       ^~~~~~~~
/usr/include/c++/12/ostream:402:33: note:   no known conversion for argument 1 from 'int' to 'std::basic_ostream<char>&&'
  402 |       operator=(basic_ostream&& __rhs)
      |                 ~~~~~~~~~~~~~~~~^~~~~
/in/foo.cc:11:9: error: expected '}' before 'else'
   11 |         else
      |         ^~~~
/in/foo.cc:9:9: note: to match this '{'
    9 |         {
      |         ^
/in/foo.cc:12:25: error: no match for 'operator=' (operand types are 'std::basic_ostream<char>' and 'int')
   12 |                 cout<<X=N;
      |                         ^
/usr/include/c++/12/ostream:402:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator=(std::basic_ostream<_CharT, _Traits>&&) [with _CharT = char; _Traits = std::char_traits<char>]'
  402 |       operator=(basic_ostream&& __rhs)
      |       ^~~~~~~~
/usr/include/c++/12/ostream:402:33: note:   no known conversion for argument 1 from 'int' to 'std::basic_ostream<char>&&'
  402 |       operator=(basic_ostream&& __rhs)
      |                 ~~~~~~~~~~~~~~~~^~~~~
/in/foo.cc: At global scope:
/in/foo.cc:14:17: error: expected unqualified-id before 'if'
   14 |                 if(X<Y)
      |                 ^~
/in/foo.cc:20:9: error: expected unqualified-id before 'return'
   20 |         return 0;
      |         ^~~~~~
/in/foo.cc:21:1: error: expected declaration before '}' token
   21 | }
      | ^

信息

递交者
类型
递交
题目
P3008 小杨的爱心快递 202512GESP1级T1
比赛
2026.1.10初级班结业测试
语言
C++
递交时间
2026-01-10 09:17:14
评测时间
2026-01-10 09:17:14
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes