#32910: 真的可以直接窮舉！？不需要動態規劃！？？

990293kwi@gmail.com (翔越風)

School : 國立臺灣海洋大學
ID : 124054
2024-02-10 22:36:17
a147. Print it all | From: [114.36.250.86] | Post Date : 2022-11-16 17:39

#32937: Re: 真的可以直接窮舉！？不需要動態規劃！？？

a110608@ctes.ylc.edu.tw (鍾均)

School : No School
ID : 183626
2023-10-23 10:25:34
a147. Print it all | From: [163.27.215.243] | Post Date : 2022-11-18 11:58

#36564: Re: 真的可以直接窮舉！？不需要動態規劃！？？

kkpp8888 (kkpp)

School : 東海大學
ID : 50549
2024-04-15 19:41:21
a147. Print it all | From: [220.133.148.253] | Post Date : 2023-07-24 06:32

m = [str(i) for i in range(10001)]
for i in range(7, 10000+1, 7):
m[i] = ""
while True:
n = int(input())
if n == 0:
break
print(" ".join(m[1:n]).replace("  "," "))

-----------------------------------------------

while True:
n = int(input())
if n==0: break
for i in range(1,n):
if i%7: print(i,end=' ')
print()

-----------------------------------------------

while True:
n = int(input())
if n==0: break
print(" ".join([str(i) for i in range(1,n) if i%7]))

ZeroJudge Forum