指针与数组练习题

题 4 编写下列函数: void find_two_largest(int a[],int n,int *largest,int *second_largest); 当传递长度为n的数组时,函数将在数组a中搜寻最大元素和第二大元素,把它们存储在分别largest和second_largest指向的变量中。 答:程序如下: #include<stdio.h> #include<stdlib.h> #
相关文章
相关标签/搜索