Commit 5bc1e8ac by BellCodeEditor

save project

parent b1872750
Showing with 13 additions and 2 deletions
......@@ -3,4 +3,16 @@ alist = []
for i in range(1, 101):
alist.append(i)
num = random.choice(alist)
print(alist)
\ No newline at end of file
def A(alist,num):
min = 0
max =len(alist)-1
while min<=max:
mid=(min+max)//2
caide=alist[mid]
if caide==zhaode:
return mid
elif caide < zhaode:
min=mid+1
elif caide > zhaode:
max=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