foo.cc: In member function 'bool Node::operator<(const Node&)':
foo.cc:11:12: error: request for member 'All' in '(Node*)this', which is of pointer type 'Node*' (maybe you meant to use '->' ?)
if (this.All != b.All)
^~~
foo.cc:12:16: error: request for member 'All' in '(Node*)this', which is of pointer type 'Node*' (maybe you meant to use '->' ?)
return this.All > b.all;
^~~
foo.cc:12:24: error: 'const struct Node' has no member named 'all'; did you mean 'All'?
return this.All > b.all;
^~~
All
foo.cc:13:12: error: request for member 'Chinese' in '(Node*)this', which is of pointer type 'Node*' (maybe you meant to use '->' ?)
if (this.Chinese != b.Chinese)
^~~~~~~
foo.cc:14:16: error: request for member 'Chinese' in '(Node*)this', which is of pointer type 'Node*' (maybe you meant to use '->' ?)
return this.Chinese > b.Chinese;
^~~~~~~
foo.cc:15:15: error: request for member 'id' in '(Node*)this', which is of pointer type 'Node*' (maybe you meant to use '->' ?)
return this.id < b.id;
^~
foo.cc: In function 'int main()':
foo.cc:23:55: warning: too many arguments for format [-Wformat-extra-args]
scanf("%d", &a[i].Chinese, &a[i].Math, &a[i].English);
^
foo.cc:27:2: error: 'sort' was not declared in this scope
sort(a + 1, a + n + 1);
^~~~
foo.cc:27:2: note: suggested alternative:
In file included from /usr/include/c++/7/algorithm:62:0,
from foo.cc:4:
/usr/include/c++/7/bits/stl_algo.h:4856:5: note: 'std::sort'
sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
^~~~
foo.cc:21:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d", &n);
~~~~~^~~~~~~~~~
foo.cc:23:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d", &a[i].Chinese, &a[i].Math, &a[i].English);
~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
自豪的采用 HydroJudger 进行评测(github.com/hydro-dev/HydroJudger)