回复 6楼 chen1204019
那是最简单了吧#include <stdio.h> #define N 10 void main() { int array[N], i, max, second_max; for(i = 0;i < N; i++) scanf("%d", &array[i]); max = second_max = -999; for (i = 0;i < N;i++) { if (array[i] >= max) { second_max = max; max = array[i]; } else if (array[i] > second_max) second_max = array[i]; } printf("second_max = %d\tmax = %d\n", second_max, max); }莫非我说的不够清楚?