解题思路:
注意事项:
参考代码: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 人评分
【回文数(二)】 (C++代码)浏览:922 |
C语言程序设计教程(第三版)课后习题1.6 (C语言代码)浏览:727 |
2004年秋浙江省计算机等级考试二级C 编程题(1) (C语言代码)浏览:532 |
核桃的数量 (C语言代码)浏览:719 |
字符逆序 (C语言代码)浏览:497 |
C二级辅导-分段函数 (C语言代码)浏览:652 |
C语言程序设计教程(第三版)课后习题11.8 (C语言代码)浏览:1051 |
【出圈】 (C++代码)简单循环浏览:694 |
1199题解浏览:699 |
整数分类问题 为什么输出总是数字8啊浏览:448 |