Commit 22120974 by BellCodeEditor

save project

parent bc12b98e
Showing with 6 additions and 10 deletions
......@@ -5,14 +5,11 @@ high=len(num_list)-1
low= 0
while low<=high:
mid=(high+low)//2
guess_num=num_list[mid]
guess_num=int(num_list[mid])
if guess_num==bingo_num:
print('找到了')
break
elif guess_num<bingo_num:
high=mid-1
elif guess_num>bingo_num:
print(mid)
exit()
elif guess_num < bingo_num:
low=mid+1
\ No newline at end of file
elif guess_num > bingo_num:
high=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