int main(void) { struStudent Student[NUM] = { {1000, "LiMing", 'M', 16, 99.5}, {1001, "NinBo", 'M', 15, 91}, {1002, "XuXin", 'F', 14, 100}, {1003, "Gaoyang", 'M', 15, 75.5}, {1004, "ZhangYu", 'F', 15, 55.5}, }; struStudent StudentTmp; StudentTmp = MaxScore(Student); printf("num:%d\n", StudentTmp.num); printf("name:%s\n", StudentTmp.name); printf("sex:%c\n", StudentTmp.sex); printf("age:%d\n", StudentTmp.age); printf("score:%.1f\n", StudentTmp.score); StudentTmp = MinScore(Student); printf("num:%d\n", StudentTmp.num); printf("name:%s\n", StudentTmp.name); printf("sex:%c\n", StudentTmp.sex); printf("age:%d\n", StudentTmp.age); printf("score:%.1f\n", StudentTmp.score); }
void main() { int score[10] = { 10, 20, 83, 95, 13, 22, 77, 45, 67, 88 }; printf("%d\n", MaxScore(score, sizeof(score) / sizeof(int))); }
int main() { int t; scanf("%d",&t); while(t--) { int n; scanf("%d",&n); int i; int arr[n]; for(i=0;i<n;i++) { scanf("%d",&arr[i]); } int x = MaxScore(arr,n); printf("%d\n",x); } return 0; }