Commit 2eb1a8e0 by BellCodeEditor

auto save

parent 4cac003e
Showing with 20 additions and 3 deletions
neme=input("输入名字") ch=['苹果','xiang',34,'dfere']
print(neme+"你好啊") print(ch[0])
\ No newline at end of file \ No newline at end of file
N=int(input())
list=[]
for i in range(1,N+1):
list.append(i)
while len(list)>2:
n1=len(list) # n1为此时list中元素的个数
m=n1-n1%3 # m为列表中序号是3的倍数中最大的
list1=list[0:m]
list2=list[m:n1]
list3=[]
for i in range(len(list1)):
if (i+1)%3!=0:
list3.append(list1[i])
list=list2+list3
if len(list)==2:
break
print(list[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