= -1) 18 { 19 printf("%d在第%d的位置上\n", x, loc); 20 }else{ 21 printf("%d不存在\n",x); 22 } 23 24 //for(i =0; i<sizeof(a)/sizeof(a[0]);i++){ 25 // printf("%d ", a[i]); 26 //} 27 return 0; 28 } 29 30 int search(int key, int a[], int ...
15 scanf("%d", &x);16 loc = search(x, a, sizeof(a)/sizeof(a[0]));17if (loc != -1)18 { 19 printf("%d在第%d的位置上\n", x, loc);20 }else{ 21 printf("%d不存在\n",x);22 } 23 24//for(i =0; i<sizeof(a)/sizeof(a[0]);i++){ 25// ...