澄某人啊


私信TA

用户名:uq_86485849906

访问量:237

签 名:

life is short. Use python

等  级
排  名 5868
经  验 1460
参赛次数 0
文章发表 1
年  龄 0
在职情况 学生
学  校 西安建筑科技大学
专  业 通信工程

  自我简介:

TA的其他文章

解题思路:

注意事项:

参考代码:n = int(input())
ls = [0] * n
j = 1; p = 0
for i in range(n-1):#让9个人出局
   while j < 3:
       p += 1
       if p == n:
           p = 0
       if ls[p] == 1:
           while ls[p] == 1:
               p += 1
               if p == n:
                   p = 0
       j += 1
   ls[p] = 1
   j = 1
   p += 1
   if p == n:
       p = 0
   if ls[p] == 1:
       while ls[p] == 1:
           p += 1
           if p == n:
               p = 0
for i in ls:
   if i == 0:
       print(ls.index(i)+1)

 

0.0分

1 人评分

  评论区

  • «
  • »