#include <stdio.h>
#define STUDENTS 3
#define EXAMS 4
int maximum(const int grades[][EXAMS]);
int minimum(const int grades[][EXAMS]);
int main(void){
int studentgrades[STUDENTS][EXAMS]={{77,68,86,73},{96,87,89,78},{70,90,86,81}};
printf("最高点:%d ",maximum
(studentgrades
)); printf("最低点:%d ",minimum
(studentgrades
)); return 0;
}
int maximum(const int grades[][EXAMS]){
int max=0;
for(int i=0;i<STUDENTS;i++){
for(int j=0;j<EXAMS;j++){
if(grades[i][j]>max)
max=grades[i][j];
}
}
return max;
}
int minimum(const int grades[][EXAMS]){
int min=100;
for(int i=0;i<STUDENTS;i++){
for(int j=0;j<EXAMS;j++){
if(grades[i][j]<min)
min=grades[i][j];
}
}
return min;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNkZWZpbmUgU1RVREVOVFMgMwojZGVmaW5lIEVYQU1TIDQKCmludCBtYXhpbXVtKGNvbnN0IGludCBncmFkZXNbXVtFWEFNU10pOwppbnQgbWluaW11bShjb25zdCBpbnQgZ3JhZGVzW11bRVhBTVNdKTsKCmludCBtYWluKHZvaWQpewoJaW50IHN0dWRlbnRncmFkZXNbU1RVREVOVFNdW0VYQU1TXT17ezc3LDY4LDg2LDczfSx7OTYsODcsODksNzh9LHs3MCw5MCw4Niw4MX19OwoJCglwcmludGYoIuacgOmrmOeCuTolZCAiLG1heGltdW0oc3R1ZGVudGdyYWRlcykpOwoJcHJpbnRmKCLmnIDkvY7ngrk6JWQgIixtaW5pbXVtKHN0dWRlbnRncmFkZXMpKTsKCXJldHVybiAwOwp9CgppbnQgbWF4aW11bShjb25zdCBpbnQgZ3JhZGVzW11bRVhBTVNdKXsKCWludCBtYXg9MDsKCWZvcihpbnQgaT0wO2k8U1RVREVOVFM7aSsrKXsKCQlmb3IoaW50IGo9MDtqPEVYQU1TO2orKyl7CgkJCWlmKGdyYWRlc1tpXVtqXT5tYXgpCgkJCW1heD1ncmFkZXNbaV1bal07CgkJfQoJfQoJcmV0dXJuIG1heDsKfQoKaW50IG1pbmltdW0oY29uc3QgaW50IGdyYWRlc1tdW0VYQU1TXSl7CglpbnQgbWluPTEwMDsKCWZvcihpbnQgaT0wO2k8U1RVREVOVFM7aSsrKXsKCQlmb3IoaW50IGo9MDtqPEVYQU1TO2orKyl7CgkJCWlmKGdyYWRlc1tpXVtqXTxtaW4pCgkJCW1pbj1ncmFkZXNbaV1bal07Cn0KfQpyZXR1cm4gbWluOwp9