Commit 6d2d57a9 by BellCodeEditor

auto save

parent 15eb9968
Showing with 16 additions and 15 deletions
# 使用二分查找法,找出9和20在列表里面的索引 def gg():
num_list = [1, 3, 5, 8, 11, 15, 17, 18, 20, 21] s=220/2
d=0 ss=s+2
c=len(num_list)-1 ss1=220-ss
b=(c+d)//2 ssss=sss+2
a=20 ssss2=220-ssss
ssssss=sssss+2
while c>d: ssssss3=220-ssssss
if a==num_list[b]: ssssssss=sssssss+2
print('猜到了') ssssssss4=220-ssssssss
if a<num_list[b]: ssssssssss=ssssssss+2
d=b+1 ssssssssss5=220-ssssssssss
elif: a=ss1+ssss2+ssssss3+ssssssss4+ssssssssss5+3
d=b-1 print(a)
\ No newline at end of file gg()
\ 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