Commit 4d453633 by BellCodeEditor

auto save

parent b16f38f3
# score = 99
# print(str(score))
# name = '悟空'
# print(int(name))
# break #退出循环
# exit() #结束
i=0
while True:
print(i)
i+=1
if i== 5:
break
\ No newline at end of file
lista =[1, 3, 9, 12, 32, 41, 45, 62, 75, 77, 82,95, 100,120,130,143,123,1245,13456,131654,46464646,464646464,644654646656,45666768]
lista =[1, 3, 9, 12, 32, 41, 45, 62, 75, 77, 82,95, 100,120,130,143,123,1245,13456,131654,46464646,464646464,644654646656,45666768]
num = 82 #查找的值
low = 0
high =len(lista)-1
while True:
mid =(low + high) // 2
if lista[mid] == num:
print('找到了',mid)
break
elif low > high:
print('没有找到')
break
elif lista[mid] < num:
low = mid + 1
else:
high = mid - 1
\ No newline at end of file
def func(n):
def func(n):
if n <= 2:
return 1
else:
value = func(n-1)+func(n-2)
return value
n = 3
while True:
if func(n) > 20:
print('第', n, '列斐波那契的值大于20')
break
n += 1
\ 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