Commit 85e4b26e by BellCodeEditor

auto save

parent 25abb509
Showing with 12 additions and 3 deletions
player=input("请出拳:石头/剪刀/布")# 玩家出拳
print("玩家出拳:"+player)
\ No newline at end of file
n=int(input('输入一个正整数N:'))
ren=list(range(1,n+1))
count=0
while len(ren)>1:
new_ren=ren[:] # 把原列表拷贝到新列表中,用于限制循环的次数
# 开始报数
for i in range(0,len(new_ren)): # 从第一个人开始报数
count=count+1 # 每报一次,计数器+1
if count%3==0:
ren.remove(new_ren[i])
print('{}'.format(ren[0]))
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