Commit 76fbe6c2 by BellCodeEditor

save project

parent 083da691
Showing with 5 additions and 4 deletions
......@@ -5,13 +5,13 @@ mina=0
maxa=len(num_list)-1
while mina<=maxa:
mid=(mina+maxa)//2
g=num_list[mid]
if g==num:
gnum=num_list[mid]
if gnum==num:
print('索引为:',mid)
break
elif g<num:
elif gnum<num:
mina=mid+1
else g>num:
else :
maxa=mid-1
if mina>maxa:
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