Commit 27a66314 by BellCodeEditor

auto save

parent 4d8b6805
Showing with 61 additions and 1 deletions
......@@ -3,11 +3,17 @@
# 请优化刚刚的代码,并增添交互效果,和自动输出最强三人信息的功能~
# 问询处
a=input("姓名:")
b=int(input("臂力值:"))
# 归档处
hero=['赵一',30,'丁二',37,'孙五',52,'王猛',89,'周亮',98,'张宇',100]
for i in range(len(hero)):
if i%2==1 and hero[i]>b:
hero.insert(i-1,a)
hero.insert(i,b)
break
print(hero[-6:])
......
# yuan=(2,3,1,4,6,5)
# print(type(yuan))
# list1=sorted(yuan)
# print(list1)
import turtle
turtle.color('red')
turtle.fillcolor("yellow")
turtle.begin_fill()
turtle.circle(200,steps=6)
turtle.end_fill()
turtle.done()
\ No newline at end of file
import turtle
def draw(x,y,ys):
turtle.goto(x,y)
turtle.pendown()
turtle.pensize(20)
turtle.pencolor(ys)
turtle.circle(50)
turtle.penup()
draw(0,0,"black")
draw(-130,0,"blue")
draw(130,0,"red")
draw(-70,-60,"yellow")
draw(70,-60,"green")
turtle.hideturtle()
turtle.done()
\ No newline at end of file
a=[19,28,30,35,39,42,48]
key=int(input())
i,j=0,len(a)-1
kk=-1
while i<j:
m=(i+j)//2
if a[m]==key:
kk=m
break
if a[m]>key:
j=m-1
print(1,m)
else:
i=m+1
print(2,m)
if a[m]>key:
kk=kk-1
else:
kk=kk+1
if a[kk]==key:
print("找到了"+str(key)+"在{}".format(kk))
else:
print("没找到!")
print(9//2)
\ 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