#include <stdio.h> void findmax ( int s[ ], int t, int *k ) { int i; *k = 0; for ( i = 1; i < t; i++) { if ( s[*k] < s[i] ) *k = i; } return ; } int main (void) { int a[10] = {12, 23, 34, 45, 56, 67, 78, 89, 11, 22}, k; findmax ( a, 10, &k ); printf ( “ 最大元素为:%d, 其下标值为:%d\n”, a[k], k ); return 0; }