Commit cde917bd by BellCodeEditor

auto save

parent 8004b61a
Showing with 5 additions and 3 deletions
...@@ -9,8 +9,10 @@ while low <= high: ...@@ -9,8 +9,10 @@ while low <= high:
mid = (low + high)//2 mid = (low + high)//2
guess = num_list[mid] guess = num_list[mid]
if guess == num: if guess == num:
print("找到了") print("找到了",mid)
break
elif guess < num: elif guess < num:
low = mid + 1 low = mid + 1
else: else:
high = mid - 1 high = mid - 1
\ No newline at end of file
\ 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