Commit 7a8cf0f4 by BellCodeEditor

save project

parent 6e08fda1
Showing with 1 additions and 1 deletions
...@@ -6,7 +6,7 @@ minIndex = len(num_list)-1 ...@@ -6,7 +6,7 @@ minIndex = len(num_list)-1
while True: while True:
mid = (minIndex + minIndex)//2 mid = (minIndex + minIndex)//2
if num_list[mid] == flag: if num_list[mid] == flag:
print("中了!!是第"+str(mid)+"数") print("中了!!是第"+str(mid+1)+"数")
break break
elif num_list[mid] > flag: elif num_list[mid] > flag:
minIndex = mid-1 minIndex = mid-1
......
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