Commit 81eebf8a by BellCodeEditor

save project

parent 393d5df2
Showing with 7 additions and 5 deletions
......@@ -4,13 +4,14 @@ flag = 17
minIndex = 0
minIndex = len(num_list)-1
while True:
mid = (minIndex + minIndex)//2
if num_list[mid] == flag:
mid = (minIndex + minIndex)//2
if num_list[mid] == flag:
print("中了!!是第"+str(mid)+"数")
elif minIndex[mid] > flag:
break
elif minIndex[mid] > flag:
minIndex = mid-1
elif minIndex[mid] < flag:
elif minIndex[mid] < flag:
minIndex = mid+1
else:
else:
print("nofoumd!!")
break
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment