Compile Error

foo.cc:7:9: error: expected ‘;’ at end of member declaration
    7 |         }
      |         ^
      |          ;
foo.cc:6:17: error: expected primary-expression before ‘return’
    6 |                 return ch+ma+en;
      |                 ^~~~~~
foo.cc:6:17: error: expected ‘}’ before ‘return’
foo.cc:5:16: note: to match this ‘{’
    5 |         int tot{
      |                ^
foo.cc:6:17: error: cannot convert ‘<brace-enclosed initializer list>’ to ‘int’ in initialization
    6 |                 return ch+ma+en;
      |                 ^~~~~~
foo.cc:6:17: error: expected ‘;’ before ‘return’
foo.cc: In member function ‘bool Node::operator<(Node)’:
foo.cc:9:27: error: expression cannot be used as a function
    9 |                 return tot()>y.tot()||tot()==y.tot()&&ch>y.ch||tot()==y.tot()&&ch==y.ch&&id<y.id;
      |                        ~~~^~
foo.cc:9:35: error: expression cannot be used as a function
    9 |                 return tot()>y.tot()||tot()==y.tot()&&ch>y.ch||tot()==y.tot()&&ch==y.ch&&id<y.id;
      |                              ~~~~~^~
foo.cc:9:42: error: expression cannot be used as a function
    9 |                 return tot()>y.tot()||tot()==y.tot()&&ch>y.ch||tot()==y.tot()&&ch==y.ch&&id<y.id;
      |                                       ~~~^~
foo.cc:9:51: error: expression cannot be used as a function
    9 |                 return tot()>y.tot()||tot()==y.tot()&&ch>y.ch||tot()==y.tot()&&ch==y.ch&&id<y.id;
      |                                              ~~~~~^~
foo.cc:9:67: error: expression cannot be used as a function
    9 |                 return tot()>y.tot()||tot()==y.tot()&&ch>y.ch||tot()==y.tot()&&ch==y.ch&&id<y.id;
      |                                                                ~~~^~
foo.cc:9:76: error: expression cannot be used as a function
    9 |                 return tot()>y.tot()||tot()==y.tot()&&ch>y.ch||tot()==y.tot()&&ch==y.ch&&id<y.id;
      |                                                                       ~~~~~^~
foo.cc: In function ‘int main()’:
foo.cc:20:58: error: expression cannot be used as a function
   20 |         for(int i=1;i<=5;i++)cout<<a[i].id<<' '<<a[i].tot()<<endl;
      |                                                  ~~~~~~~~^~

信息

递交者
类型
递交
题目
P1455 奖学金
语言
C++
递交时间
2025-07-18 20:06:29
评测时间
2025-07-18 20:06:29
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes