foo.cc: In function 'int main()':
foo.cc:36:2: error: 'sort' was not declared in this scope; did you mean 'std::sort'?
36 | sort(student + 1, student + n + 1, compare);
| ^~~~
| std::sort
In file included from /usr/include/c++/9/algorithm:62,
from foo.cc:3:
/usr/include/c++/9/bits/stl_algo.h:4893:5: note: 'std::sort' declared here
4893 | sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
| ^~~~
foo.cc:30:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
30 | scanf("%d", &n);
| ~~~~~^~~~~~~~~~
foo.cc:33:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
33 | scanf("%d %d %d", &student[i].c_score, &student[i].m_score, &student[i].e_score);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[Hydro](https://hydro.ac)提供评测服务