Commit f42de405 by BellCodeEditor

save project

parent 4e3f708f
Showing with 10 additions and 13 deletions
......@@ -5,15 +5,12 @@ low=0
high =len(num_list)-1
while low <= high:
mid = (low+high)//2
guess = num_list[mid]
if high < low:
print("没有这个数")
else:
if guess == number:
print("索引值",mid)
break
elif guess < number:
low = mid+1
elif guess > number:
high = mid-1
\ No newline at end of file
guess = num_list[mid]
if guess == number:
print("索引值",mid)
break
elif guess < number:
low = mid+1
else guess > number:
high = mid-1
print("没有这个数")
\ 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