Commit c4822bf4 by BellCodeEditor

save project

parent 7c25908a
Showing with 8 additions and 9 deletions
...@@ -12,11 +12,10 @@ def erfen(num,low,high): ...@@ -12,11 +12,10 @@ def erfen(num,low,high):
else: else:
high=mid-1 high=mid-1
num_list = [1, 3, 5, 8, 11, 15, 17, 18, 20, 21] num_list = [1, 3, 5, 8, 11, 15, 17, 18, 20, 21]
if erfen(9,0,len(num_list)-1)==0: num=1
print("没找到") while(num!=0):
else: num=int(input())
print(erfen(9,0,len(num_list)-1)) if erfen(num,0,len(num_list)-1)==0:
if erfen(20,0,len(num_list)-1)==0: print("没找到")
print("没找到") else:
else: print("找到了,他在列表里的索引是:",erfen(num,0,len(num_list)-1))
print(erfen(20,0,len(num_list)-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