C++ 编程题:求其他同学的最高分 - 代码解析与优化
#include
int main() {
int N;
cin >> N;
vector
for (int i = 0; i < N; i++) {
int max_score = 0;
for (int j = 0; j < N; j++) {
if (j != i) {
max_score = max(max_score, scores[j]);
}
}
cout << max_score << endl;
}
return 0;
}
原文地址: https://www.cveoy.top/t/topic/qyiO 著作权归作者所有。请勿转载和采集!