题目内容:
请编写一个函数int proc(int*s,int t,int*k),用来求出数组的最小元素在数组中的下标并存放在k所指的存储单元中。例如,输人如下整数:
273 934 453 624 89 342 111 831 527 246
则输出结果为4,89。
注意:部分源程序给出如下。
请勿改动main()函数和其他函数中的任何内容,仅在函数proc()的花括号中填入所编写的若十语句。
试题程序:
#include<stdlib.h>
#include<conio.h>
#include<stdio.h、>
void proc(int*S,int t.int*k)
{ }
void main()
{
int arr[10]={273,934,453,624,89,342,111,
831,527,246},K:
system("CLS"):
proc(arr,10,&k):
printf("%d,%d\n",k,arr[k]);
}
参考答案:
答案解析: