【正文】
 ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄一、地址和數(shù)組間的關(guān)系;;。三、實(shí)驗(yàn)內(nèi)容 sort(int a[],int n)amain函數(shù),并在其中調(diào)用sort函數(shù)。要求定義和調(diào)用函數(shù)search(int list[], int n, int x),在數(shù)組list中查找元素x,若找到則返回相應(yīng)下標(biāo),否則返回1。然后把正確的代碼(按規(guī)范縮進(jìn))寫入報(bào)告,并以注釋的方式說明錯(cuò)誤原因。/*循環(huán)控制變量不能定義為double類型*/提示:這是一個(gè)雙重循環(huán)問題,內(nèi)循環(huán)進(jìn)行循環(huán)移位,外循環(huán)確定后移的位置。從Last : 4提示:可以把編號存在一個(gè)數(shù)組中,報(bào)到3的人賦值為0表示退出。四、程序清單第一題includevoid swap(int *,int*)。void main(){int i,n,a[8]。scanf(“%d”,amp。printf(“Input array of %d integers: ”,n)。iscanf(“%d”,amp。sort(a,n)。for(i=0。printf(“n”)。for(i=0。for(j=i+1。swap(amp。a[index])。t=*px。*py=t。void main(){int i,x,result,a[10]。for(i=0。a[i])。scanf(“%d”,amp。result=search(a,10,x)。elseprintf(“The position is %dn”,result)。}int search(int list[],int n,int x){int i,result=1。iif(list[i]==x){result=i。}return result。int main(){int m, n, i, a[80], *p。scanf