以下是实现该功能的C语言代码:
#include <stdio.h>
int main() {
int score, max = -1, min = 101; // 初始最大值为-1,最小值为101
while (1) {
printf("请输入学生成绩:");
scanf("%d", &score);
if (score < 0) {
break; // 输入负数时跳出循环
}
if (score > max) {
max = sc