第一次完全黑化那集集末他撒了女神的现任男友,就在女神家门前不远~~
"#include&lt;stdio.h&gt;<br>int seek(int * pArr,int low,int high,int num);<br>void main()<br>{<br> int Arr[]={1,2,3,4,5,6,7,8,9,10};<br> int find,num;<br> printf(""input a num to be found.\n"");<br> scanf(""%d"",&num);<br> find = seek(Arr,0,9,num);<br> if (find == -1) printf(""num=%d not found!\n"",num);<br> else printf(""num has been found!\nArr[%d] = %d\n"",find,Arr[find]);<br>}<br>int seek (int *pArr,int low,int high,int num)<br>{//pArr 为数组名,该数组必须是排好序了(这是二分法的要求),这里按从小到大排序<br> int mid;<br> mid = (low+high)/2;<br> if ((low&gt;=high)&&(pArr[mid]!=num))<br> return -1;<br> else <br> {<br> if (pArr[mid]==num)<br> return mid;<br> else if (pArr[mid]&gt;num)<br> high = mid+1;//中间数字比要查的数还大,说明可能在中间段以前<br> else <br> low = mid-1;//同上,可能在中间段以后<br> return seek(pArr,low,high,num); //递归 <br> }<br>}"