完整程序2 include <stdio.h> Define ARR SIZE 40 void FindMax(float scored, long numb, int n, float pMaxScore long* pMaxNum):/函数声明*/ maino void FindMax(float score[, long num[, int n float scorel float*pMax Score, long*pMaxNum) int n,i:[ long num[ printf( Pleas pMaxScore score[o] scanf( yod printf("Pleas pMaxNum num[O] for〔i=0:i< for (i=l; i<n: i++) SCal if (score[i]>*pMaxScore) FindMax(scd pMaxScore score[]: pMaxNum num[i] o printf("max,18 完整程序2 #include <stdio.h> #define ARR_SIZE 40 void FindMax(float score[], long num[], int n, float *pMaxScore, long *pMaxNum); /*函数声明*/ main() { float score[ARR_SIZE], maxScore; int n, i; long num[ARR_SIZE], maxNum; printf("Please enter total number:"); scanf("%d", &n); /*从键盘输入学生人数n*/ printf("Please enter the number and score:\n"); for (i=0; i<n; i++) /*分别以长整型和实型格式输入学生的学号和成绩*/ { scanf("%ld%f", &num[i], &score[i]); } FindMax(score, num,n, &maxScore, &maxNum); /*计算最高分和学号 */ printf("maxScore = %.0f, maxNum = %ld\n",maxScore, maxNum); } void FindMax(float score[], long num[], int n, float *pMaxScore, long *pMaxNum) { int i; *pMaxScore = score[0]; *pMaxNum = num[0]; for (i=1; i<n; i++) { if (score[i] > *pMaxScore) { *pMaxScore = score[i]; *pMaxNum = num[i]; } } }