1
0
mirror of https://github.com/renbaoshuo/202401-programming-assignments.git synced 2024-12-16 15:44:39 +00:00
202401-programming-assignments/【实践课外】13.指针1/6-2 找最大值及其下标.c

12 lines
165 B
C
Raw Permalink Normal View History

2024-11-29 08:43:30 +00:00
int fun(int *a, int *b, int n) {
*b = 0;
for (int i = 1; i < n; i++) {
if (a[i] > a[*b]) {
*b = i;
}
}
return a[*b];
}