mirror of
https://github.com/codeflash-ai/codeflash-internal.git
synced 2026-05-04 18:25:18 +00:00
30 lines
377 B
Python
30 lines
377 B
Python
def problem_p02406(input_data):
|
|
n = int(input_data)
|
|
|
|
i = 1
|
|
|
|
SP = []
|
|
|
|
while i <= n:
|
|
|
|
x = i
|
|
|
|
if x % 3 == 0:
|
|
|
|
SP.append(str(i))
|
|
|
|
else:
|
|
|
|
while x:
|
|
|
|
if x % 10 == 3:
|
|
|
|
SP.append(str(i))
|
|
|
|
break
|
|
|
|
x /= 10
|
|
|
|
i += 1
|
|
|
|
return ("", " ".join(SP))
|