Commit 393d5df2 by BellCodeEditor

save project

parent 40c6ceae
Showing with 1 additions and 0 deletions
...@@ -3,6 +3,7 @@ num_list = [1, 3, 5, 8, 11, 15, 17, 18, 20, 21] ...@@ -3,6 +3,7 @@ num_list = [1, 3, 5, 8, 11, 15, 17, 18, 20, 21]
flag = 17 flag = 17
minIndex = 0 minIndex = 0
minIndex = len(num_list)-1 minIndex = len(num_list)-1
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)+"数")
......
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