Problem:


Structured Programming

In programming languages like C/C++, a goto statement provides an unconditional jump from the "goto" to a labeled statement. For example, a statement "goto CHECK_NUM;" is executed, control of the program jumps to CHECK_NUM. Using these constructs, you can implement, for example, loops.

Note that use of goto statement is highly discouraged, because it is difficult to trace the control flow of a program which includes goto.

Write a program which does precisely the same thing as the following program (this example is wrtten in C++). Let's try to write the program without goto statements.

void call(int n){
  int i = 1;
 CHECK_NUM:
  int x = i;
  if ( x % 3 == 0 ){
    cout n is given in a line.

Output

Print the output result of the above program for given integer n.

Constraints

3 ≤ n ≤ 10000

Sample Input

30

Sample Output

 3 6 9 12 13 15 18 21 23 24 27 30

  Put a single space character before each element.



Sample input:
30


Sample output:
 3 6 9 12 13 15 18 21 23 24 27 30

Submission status: Wrong Answer

Solution code:
n = int(input())
i = 1

while i <= n:
	x = i
	if x % 3 == 0:
		print(" ", end ="")
		print(i, end ="")
	elif x % 10 == 3:
		print(" ", end ="")
		print(i, end ="")
	else:
		x = x / 10
	i += 1
print()

Submission status: Wrong Answer

Solution code:
n = int(input())
i = 1

while i <= n:
	x = i
	while True:
		if x / 10 == 0:
			break;
		if x % 3 == 0:
			print(" ", end ="")
			print(i, end ="")
			break
		elif x % 10 == 3:
			print(" ", end ="")
			print(i, end ="")
			break
		else:
			x = int(x / 10)
	i += 1
print()

Submission status: Wrong Answer

Solution code:
n = int(input())
i = 1

while i <= n:
	
	x = i
	
	if x % 3 == 0:
		print(" ", end ="")
		print(i, end ="")
		
	while x != 0:
		if x % 10 == 3:
			print(" ", end ="")
			print(i, end ="")
			break
		else:
			x = int(x / 10)
			
	i += 1
print()

Submission status: Wrong Answer

Solution code:
n = int(input())

for i in range(1, n + 1):
    if i % 3 == 0 or i % 10 == 3:
        print(' {}'.format(i), end='')
print()

Submission status: Wrong Answer

Solution code:
def include_three(n):
    k = 1
    j = 10 ** k
    while j <= n:
        if n % j == 3 or n // j == 3:
            return True
        else:
            return False
        k += 1

n = int(input())

for i in range(1, n + 1):
    if i % 3 == 0 or include_three(i):
        print(' {}'.format(i), end='')
print()

Submission status: Wrong Answer

Solution code:
def call(n):
    op = False

    for idx in range(1, n):
        if idx % 3 == 0:
            op = True
        if idx % 10 == 3:
            op = True
        if op == True:
            print(' ' + str(idx), end = '')
        op = False
    idx += 1
    print(' ' + str(idx), end = '')

Submission status: Wrong Answer

Solution code:
num = int(input())
x=""

for i in range(1, num+1):
	 if i % 3 == 0:
	 	x += (" " + str(i))
print(x)

Submission status: Wrong Answer

Solution code:
def call(n):

    i = 0
    while True:
        i += 1
        if i > n:
            break
        x = i
        if x % 3 == 0:
            print(' ' + str(i), end = '')
            continue

        while True:
            if x % 10 == 3:
                print(' ' + str(i), end = '')
                break
            x /= 10
            if x == 0:
                break
            
    print()

Submission status: Wrong Answer

Solution code:
n = int(input())
i = 0
while True:
    i += 1
    if i > n:
        break
    x = i
    if x % 3 == 0:
        print(' ' + str(i), end = '')
        continue

    while True:
        if x % 10 == 3:
            print(' ' + str(i), end = '')
            break
        x /= 10
        if x == 0:
            break
            
print()

Submission status: Wrong Answer

Solution code:
n = int(input())

def call(n):
    i = 0
    while True:
        i += 1
        if i > n:
            break
        x = i
        if x % 3 == 0:
            print(' ' + str(i), end = '')
            continue

        while True:
            if x % 10 == 3:
                print(' ' + str(i), end = '')
                break
            x /= 10
            if x == 0:
                break
            
    print()
    
call(n)

Submission status: Wrong Answer

Solution code:
num = int(input())
nabeatu = ""
for i in range(num + 1):
    if i % 3 == 0 or "3" in str(i):
        nabeatu = nabeatu + str(i) + " "
print(nabeatu)

Submission status: Wrong Answer

Solution code:
import sys
n = int(input())
sys.stdout.write(" ")
answer = []
for i in range(n + 1):
    if i%3 == 0:
        answer.append(i)
    elif '3' in str(i):
        answer.append(i)
print(*answer)

Submission status: Wrong Answer

Solution code:
a=[]
n=int(input())
for i in range(3,n+1):
    if i%3==0 or i%10==3:
        a.append(i)
print(' ', end='')
print(*a)

Submission status: Wrong Answer

Solution code:
a=[]
n=int(input())
for i in range(3,n+1):
    if i%3==0 or i%10==3:
        a.append(i)
    else:
        i/=10
        if i%10==3:
            a.append(i)
print(' ', end='')
print(*a)

Submission status: Wrong Answer

Solution code:
n = int(input())                                                                
for i in range(n + 1):
    if i != 0:
        if i % 3 == 0:
            print('',i,end='')
        elif '3' in str(i):
            print('',i,end='')
    print('')

Submission status: Wrong Answer

Solution code:
a=int(input())

for i in range(3,a+1):
    if i% 3==0:
        print(" "+str(i),end=" ")

Submission status: Wrong Answer

Solution code:
a=int(input())

for i in range(3,a+1):
    if i% 3==0:
        print(" "+str(i),end=" ")

    else:
        s=str(i)
        if "3" in s:
            print(" "+str(i),end=" ")

    print()

Submission status: Wrong Answer

Solution code:
a=int(input())

for i in range(3,a+1):
    if i% 3==0:
        print(" "+str(i),end=" ")

    else:
        s=str(i)
        if "3" in s:
            print(" "+str(i),end=" ")

    print(" ")

Submission status: Wrong Answer

Solution code:
data = int(input())
print(end=" ")
for i in range(1, data+1):
    j = i
    while j >= 10:
        j = j // 10
        if j == 3:
            print(i, end=" ")
            break
    if i % 3 == 0 or i % 10 == 3:
        print(i, end=" ")

Submission status: Wrong Answer

Solution code:
n = int(input())
for n in range(3, n+1):
    if n % 3 == 0:
        print(' {}'.format(n), end='')
        continue
    if n % 10 == 3:
        print(' {}'.format(n), end='')
        continue
print()

Submission status: Wrong Answer

Solution code:
n = int(input())
for i in range(1, n+1):
 if i%3 == 0:
  print(" " + str(i))
 elif i%10 == 3:
  print(" " + str(i))
 div = i
 while div//10:
  div = div//10
  if div%10 == 3:
   print(" " + str(div))
   div = 0

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = ''
for i in range(1, n+1):
 if i%3 == 0:
  ans += " " + str(i)
 elif i%10 == 3:
  ans += " " + str(i)
 div = i
 while div//10:
  div = div//10
  if div%10 == 3:
   ans += " " + str(div)
   div = 0
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = ''
for i in range(1, n+1):
 if i%3 == 0:
  ans += " " + str(i)
 elif i%10 == 3:
  ans += " " + str(i)
 div = i
 while div//10:
  div = div//10
  if div%10 == 3:
   ans += " " + str(i)
   div = 0
print(ans)

Submission status: Wrong Answer

Solution code:
# (c) midandfeed
n = int(input())
	
for i in range(1, n+1):
	if (i%3==0) or (i%10==3):
		print(" {}".format(i), end='')
print()

Submission status: Wrong Answer

Solution code:
# (c) midandfeed
n = int(input())
	
for i in range(1, n+1):
	x = i
	if (x%3==0) or (x%10==3):
		print(" {}".format(x), end='')
	elif ((x//10)%10==3):
		print(" {}".format(x), end='')
print()

Submission status: Wrong Answer

Solution code:
n = int(input())
result = []
def check(x, y, remnant):
    return x % y == remnant

for i in range(1, n + 1):
    x = i
    if check(x, 3, 0):
        result.append(i)
        continue
    for j in range(len(str(x)) - 1):
        if check(x, 10, 3):
            result.append(i)
            break
        x //= 10
print(' ' + ' '.join(map(str, result)))

Submission status: Wrong Answer

Solution code:
n = int(input())
result = []
def check(x, y, remnant):
    return x % y == remnant

for i in range(1, n + 1):
    x = i
    if check(x, 3, 0):
        result.append(i)
        continue
    for j in range(len(str(x)) - 1):
        if check(x, 10, 3):
            result.append(i)
            break
        x //= 10
if len(result) == 0:
    print()
else:
    print(' ' + ' '.join(map(str, result)))

Submission status: Wrong Answer

Solution code:
n = int(input())
result = []
def check(x, y, remnant):
    return x % y == remnant

for i in range(1, n + 2):
    x = i
    if check(x, 3, 0):
        result.append(i)
        continue
    for j in range(len(str(x)) - 1):
        if check(x, 10, 3):
            result.append(i)
            break
        x //= 10
if len(result) == 0:
    print()
else:
    print(' ' + ' '.join(map(str, result)))

Submission status: Wrong Answer

Solution code:
n = int(input())
for i in range(n):
    if (i+1)%3 == 0 or (i+1)%10 == 0:
        print(" " + str(i+1), end='')

Submission status: Wrong Answer

Solution code:
n = int(input())
for i in range(n):
    if (i+1)%3 == 0 or (i+1)%10 == 0:
        print(" " + str(i+1), end='')
print()

Submission status: Wrong Answer

Solution code:
n = int(input())
for i in range(n):
    if (i+1)%3 == 0 and not (i+1)%10 == 0:
        print(" " + str(i+1), end='')
print()

Submission status: Wrong Answer

Solution code:
n = int(input())
for i in range(n):
    if (i+1)%3 == 0 or (i+1)%10 == 3:
        print(" " + str(i+1), end='')
print()

Submission status: Wrong Answer

Solution code:
import sys

n = int(raw_input())

for i in range(1, n+1):
	if i % 3 == 0:
		sys.stdout.write(" {:}".format(i))
	if str(i).find('3') > -1:
		sys.stdout.write(" {:}".format(i))

Submission status: Wrong Answer

Solution code:
import sys

n = int(raw_input())

for i in range(1, n+1):
	if i % 3 == 0:
		sys.stdout.write(".{:}".format(i))
	elif str(i).find('3') > -1:
		sys.stdout.write(".{:}".format(i))
	print("")

Submission status: Wrong Answer

Solution code:
import sys

n = int(raw_input())

for i in range(1, n+1):
	if i % 3 == 0:
		sys.stdout.write(" {:}".format(i))
	elif str(i).find('3') > -1:
		sys.stdout.write(" {:}".format(i))
	print("")

Submission status: Wrong Answer

Solution code:
n=input()
s=''
for i in range(int(n)+1):
    s += (str(i) + ' ') if i%3==0 or '3' in str(i) else ''
print(s)

Submission status: Wrong Answer

Solution code:
n=input()
s=''
for i in range(1,int(n)+1):
    s += (str(i) + ' ') if i%3==0 or '3' in str(i) else ''
print(s[0:int(n)])

Submission status: Wrong Answer

Solution code:
def main():
    n = int(input())
    _list = list(range(1,n+1))
    for x in _list:
        if x % 3 == 0 or x % 10 == 3:
            print(' %d' %  x, end = '')
    print('')
    

main()

Submission status: Wrong Answer

Solution code:
#3????????°??¨10??§?????£????????????3??????????????????print?????????
#???????????????????????§??????????????????????????????
#???????????°????????\????????¨???????????????
#??????????????¨????????????????????¶??§???????????°????????????????????????????????????
#3????????°?????????3?¶?????????°?????\??????????¶?????????°?????????????????????????????§??????
#?????????????????????
#?????????10??§?????£????????????3??????????????????????????????????????????
#??\??????????????§??????????????????3?????¨?????????????????????????????????
#????????????????????¨21??§???????????????????????????
#????????????????????¨3?????¨?????¨????????????????????\??£???????????????
x = int(input())
i = 1
print(" ", end="")
while i <= x:
    
    if (i % 3) == 0:
        if (i + 3) <= x:
            print(i, end=" ")
        elif x > 3 and (x % 10) == 3:
            print(i, end=" ")
        else:
            print(i)
      
    elif (i % 10) == 3:
        if i != x:
            print(i, end=" ")
        else:
            print(i)
    
    i += 1

Submission status: Wrong Answer

Solution code:
import sys

def main():
    lines = sys.stdin.readlines()
    input_num = 0
    for line in lines:
        # print(line)
        # rm '\n' from string of a line
        line = line.strip('\n')
        input_num = int(line)
        # print input_num
        index_num = 1
        while True:
            x = index_num
            if x % 3 == 0:
                print " " + str(x)
                if (index_num + 1) > input_num:
                    break
                index_num += 1
                # print index_num
                continue
            while True:
                if x % 10 == 3:
                    print " " + str(x)
                if x / 10 == 0:
                    break
                else:
                    x /= 10
            if (index_num + 1) > input_num:
                break
            else:
                index_num += 1
                # print index_num

        break


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import sys

def main():
    lines = sys.stdin.readlines()
    input_num = 0
    ans = []
    for line in lines:
        # print(line)
        # rm '\n' from string of a line
        line = line.strip('\n')
        input_num = int(line)
        # print input_num
        index_num = 1
        while True:
            x = index_num
            if x % 3 == 0:
                ans.append(x)
                if (index_num + 1) > input_num:
                    break
                index_num += 1
                # print index_num
                continue
            while True:
                if x % 10 == 3:
                    ans.append(x)
                if x / 10 == 0:
                    break
                else:
                    x /= 10
            if (index_num + 1) > input_num:
                break
            else:
                index_num += 1
                # print index_num

        break
    ans_s = ""
    for e in ans:
        ans_s += " " + str(e)
    print ans_s


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import sys

def main():
    lines = sys.stdin.readlines()
    input_num = 0
    ans = []
    for line in lines:
        # print(line)
        # rm '\n' from string of a line
        line = line.strip('\n')
        input_num = int(line)
        # print input_num
        index_num = 1
        while True:
            x = index_num
            if x % 3 == 0:
                ans.append(x)
                if (index_num + 1) > input_num:
                    break
                index_num += 1
                # print index_num
                continue
            one_n = 0
            while True:
                if x % 10 == 3:
                    ans.append(30 + one_n)
                if x / 10 == 0:
                    break
                else:
                    one_n = x % 10
                    x /= 10
            if (index_num + 1) > input_num:
                break
            else:
                index_num += 1
                # print index_num

        break
    ans_s = ""
    for e in ans:
        ans_s += " " + str(e)
    print ans_s


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import sys

def main():
    lines = sys.stdin.readlines()
    input_num = 0
    ans = []
    for line in lines:
        # print(line)
        # rm '\n' from string of a line
        line = line.strip('\n')
        input_num = int(line)
        # print input_num
        index_num = 1
        while True:
            x = index_num
            if x % 3 == 0:
                ans.append(x)
                if (index_num + 1) > input_num:
                    break
                index_num += 1
                # print index_num
                continue
            one_n = 0
            th_f = 0
            while True:
                if x % 10 == 3:
                    if th_f == 1:
                        ans.append(30 + one_n)
                    else:
                        ans.append(x)
                if x / 10 == 0:
                    break
                else:
                    one_n = x % 10
                    x /= 10
                    th_f = 1
            if (index_num + 1) > input_num:
                break
            else:
                index_num += 1
                # print index_num

        break
    ans_s = ""
    for e in ans:
        ans_s += " " + str(e)
    print ans_s


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
#3????????°??¨10??§?????£????????????3??????????????????print?????????
#???????????????????????§??????????????????????????????
#???????????°????????\????????¨???????????????
#??????????????¨????????????????????¶??§???????????°????????????????????????????????????
#3????????°?????????3?¶?????????°?????\??????????¶?????????°?????????????????????????????§??????
#?????????????????????
#?????????10??§?????£????????????3??????????????????????????????????????????
#??\??????????????§??????????????????3?????¨?????????????????????????????????
#????????????????????¨21??§???????????????????????????
#????????????????????¨3?????¨?????¨????????????????????\??£???????????????
#??§????????¨?????£???????????????????????????3?????\??£????????????????????????????????????
#?????????????????????????????????????????????????????§???????????????????????????????????\?????¢??°??¨???????????????????????¨?????§???????????????????????§?????¶?????¢??§??????????????????????????????????????????
x = int(input())
i = 1
print(" ", end="")
while i <= x:
    if i // 10 == 3:
        if i == x:
            print(i)
        else:
            print(i, end=" ")
    else:
        if (i % 3) == 0:
            if (i + 3) <= x:
                print(i, end=" ")
            elif x > 3 and (x % 10) == 3:
                print(i, end=" ")
            else:
                print(i)
      
        elif (i % 10) == 3:
            if i != x:
                print(i, end=" ")
            else:
                print(i)
    
    i += 1

Submission status: Wrong Answer

Solution code:
n=int(input())
for i in range(3,n+1,3):print(i)

Submission status: Wrong Answer

Solution code:
import sys
n=int(input())
a=[]
for i in range(1,n+1):
    if (i%3==0):
        a.append(i)
    else:
        j=str(i)
        for k in range(len(j)-1):
            if j[k]=="3":
                a.append(i)
                break
for i in a:
    sys.stdout.write(" {0}".format(i))
sys.stdout.write("\n")

Submission status: Wrong Answer

Solution code:
def main():
    n = int(input())
    for i in range(3, n + 1, 3):
        print("", i, end="")
    print("")

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
n = int(input())
result = []
for i in range(1, n+1):
    if (i % 3 == 0) or (i // 10 == 3):
        result.append(str(i))
print(' '.join(result))

Submission status: Wrong Answer

Solution code:
n = int(input())
result = ''
for i in range(1, n+1):
    if (i % 3 == 0) or (i // 10 == 3):
        result += (' ' + str(i))
print(result)

Submission status: Wrong Answer

Solution code:
n = int(input())
result = ''
for i in range(1, n+1):
    if (i % 3 == 0) or (i % 10 == 3):
        result += (' ' + str(i))
print(result)

Submission status: Wrong Answer

Solution code:
n = int(input())
result = ''
for i in range(3, n+1):
    if (i % 3 == 0) or (i % 10 == 3):
        result += (' ' + str(i))
print(result)

Submission status: Wrong Answer

Solution code:
n = int(input())
result = ''
for i in range(3, n+1):
    if (i % 3 == 0) or (i % 10 == 3) or (i // 10 == 3):
        result += (' ' + str(i))
print(result)

Submission status: Wrong Answer

Solution code:
def threeDivCheck(x):
  if x % 3 == 0: return x
  return 0

def threeIncludeCheck(x):
  y = x
  while y!=0:
    if y%10 == 3:
      return x
    y/=10
  return 0

def main():
  n = int(input())
  p = 0
  for i in range(n+1):
    p = threeDivCheck(i)
    if p:
      print(' {}'.format(p), end='')
    else:
      p=threeIncludeCheck(i)
      if p:
        print(' {}'.format(p), end='')
  print()

Submission status: Wrong Answer

Solution code:
def threeDivCheck(x):
  if x % 3 == 0: return x
  return 0

def threeIncludeCheck(x):
  y = x
  while y!=0:
    if y%10 == 3:
      return x
    y/=10
  return 0

def main():
  n = int(input())
  p = 0
  for i in range(n+1):
    p = threeDivCheck(i)
    if p:
      print(' {}'.format(p), end='')
    else:
      p=threeIncludeCheck(i)
      if p:
        print(' {}'.format(p), end='')

Submission status: Wrong Answer

Solution code:
def threeDivCheck(x):
  if x % 3 == 0: return x
  return 0

def threeIncludeCheck(x):
  y = x
  while y!=0:
    if y%10 == 3:
      return x
    y/=10
  return 0

def main():
  n = int(input())
  p = 0
  for i in range(n+1):
    p = threeDivCheck(i)
    if p:
      print(' {}'.format(p), end='')
    else:
      p=threeIncludeCheck(i)
      if p:
        print(' {}'.format(p), end='')
  print()

main()

Submission status: Wrong Answer

Solution code:
def main():
    """
    n=30
     3 6 9 12 13 15 18 21 23 24 27 30
    """
    n = int(input())
    for x in range(1, n + 1):
        if x % 3 == 0:
            print("", x, end="")
            continue

        while x > 0:
            if x % 10 == 3:
                print("", x, end="")
                break

            x //= 10

    print("")

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
def CheckNum(n, x, i):
	x = i
	if x % 3 == 0:
		print(" %d"%(i), end="")
		return 2, i, x
	return 1, i, x

def Include3(n, x, i):
	if x % 10 == 3:
		print(" %d"%(i), end="")
		return 2, i, x
	x /= 10
	if x != 0:
		return 1, i, x
	return 2, i, x

def EndCheckNum(n, x, i):
	i += 1
	if i <= n:
		return 0, i, x
	print("")
	return 3, i, x
	
def call(n):
	counter = 0
	i = 1
	x = 1
	func = [CheckNum, Include3, EndCheckNum]
	while counter != 3:
		counter, i, x = func[counter](n, x, i)

n = int(input())
call(n)

Submission status: Wrong Answer

Solution code:
for i in range(1,int(input())+1):
 a=i
 while(a>0):
  if a%3==0:
   print(i,end='')
   break
  a/=10

Submission status: Wrong Answer

Solution code:
for i in range(1,int(input())+1):
 a=i
 while(a>0):
  if a%3==0:
   print(i,end=' ')
   break
  a/=10

Submission status: Wrong Answer

Solution code:
for i in range(1,int(input())+1):
 a=i
 while(a>0):
  if a%3==0 or a%10==3:
   print(f' {i}',end='')
   break
  a/=10
 print()

Submission status: Wrong Answer

Solution code:
n=int(input())
m=[]
for i in range(1,n+1):
 a=i
 if a%3==0:
  m.append(i)
  continue
 while a>0:
  if a%10==3:
   m.append(i)
   break
  a/=10
print(' ',end='')
print(*m)

Submission status: Wrong Answer

Solution code:
n = int(input())
list = [' ']
for i in range(n+1):
    if i % 3 == 0 or "3" in str(i):
        list.append(i)

print(*list)

Submission status: Wrong Answer

Solution code:
H = int(input())
str =""
for i in range(1,H+1):
    if i%3==0 or "%d"%(i)in "3":
        str+="%d "%(i)
print(str[0:-1])

Submission status: Wrong Answer

Solution code:
num = int(input())
for i in range(0,num+1):
    if i % 3 == 0 or '3' in str(i):
        print('{}'.format(i))

Submission status: Wrong Answer

Solution code:
num = int(input())
for i in range(0,num+1):
    if i % 3 == 0 or '3' in str(i):
        print(' {}'.format(i),end="")
print();

Submission status: Wrong Answer

Solution code:
n = int(input())

for i in range(3,n+1):
    if i % 3 == 0 or i % 10 == 3:
        print(' ' + str(i), end='')
print()

Submission status: Wrong Answer

Solution code:

n = int(input())

for i in range(3,n+1):
    if i % 3 == 0 or i % 10 == 3 or int(i / 10) == 3:
        print(' ' + str(i), end='')
print()

Submission status: Wrong Answer

Solution code:
n = int(input())

result = []
for i in range(3, n + 1):
    if i % 3 == 0:
        result.append(i)
    else:
        for j in result:
            if j == "3":
                result.append(i)
print(*result)

Submission status: Wrong Answer

Solution code:
n = int(input())

result = [" "]
for i in range(3, n + 1):
    if i % 3 == 0:
        result.append(i)
    else:
        for j in result:
            if j == "3":
                result.append(i)
print(*result)

Submission status: Wrong Answer

Solution code:
n = int(input())

result = []
for i in range(3, n + 1):
    if i % 3 == 0:
        result.append(i)
    elif "3" in str(result):
        result.append(i)
print(*result)

Submission status: Wrong Answer

Solution code:
n = int(input())

result = [" "]
for i in range(3, n + 1):
    if i % 3 == 0:
        result.append(i)
    elif "3" in str(result):
        result.append(i)
print(*result)

Submission status: Wrong Answer

Solution code:
def main():
    n = int(input())

    for i in range(n+1):
        if i % 3 == 0 or i % 3 == 10:
            print(i,end=" ")

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
def main():
    n = int(input())

    for i in range(n+1):
        if i % 3 == 0 or i % 3 == 0:
            print(i,end=" ")

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
def main():
    n = int(input())

    for i in range(n+1):
        if i % 3 == 0 or i % 10 == 3:
            print(i,end=" ")

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
def nabeatsu(a):
    if a % 3 == 0:
        return True

    while a != 0:
        if a % 10 == 3:
            return True

        a //= 10

    return False

def main():
    n = int(input())

    for i in range(1,n+1):
        if nabeatsu(i):
            print("???{0}".format(i),end="")

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
#coding: utf-8
def nabeatsu(a):
    if a % 3 == 0:
        return True

    while a != 0:
        if a % 10 == 3:
            return True

        a //= 10

    return False

def main():
    n = int(input())

    for i in range(1,n+1):
        if nabeatsu(i):
            print("???{0}".format(i),end="")

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
n = int(input())
for i in range(1,n+1):
  if i % 3==0 or i % 10 ==3:
    print(i,end=' ')
  print('')

Submission status: Wrong Answer

Solution code:
n = int(input())

i = 1
while i <= n:
    if i % 3 ==0:
        print(" {:d}".format(i),end="")
    elif i % 10 == 3:
        print(" {:d}".format(i),end="")
    i += 1

print("")

Submission status: Wrong Answer

Solution code:
a = raw_input()
print '',
for i in range(1,int(a)+1):
    if(i % 3 == 0 or i % 10 == 3):
        print i,

Submission status: Wrong Answer

Solution code:
n = int(input())

i = 1
while i <= n:
    if i % 3 == 0:
        print(" {:d}".format(i),end="")
    elif i % 10 == 3:
        print(" {:d}".format(i),end="")
    i += 1
print("")

Submission status: Wrong Answer

Solution code:
n = int(input())

i = 1
while i <= n:
    if (i % 3) == 0:
        print(" {:d}".format(i),end="")
    elif (i % 10) == 3:
        print(" {:d}".format(i),end="")
    i += 1
print("")

Submission status: Wrong Answer

Solution code:
a = raw_input()
print '',
for i in range(1,int(a)+1):
    b = i
    if(b % 3 == 0 or b % 10 == 3):
        print i,
        continue
    b /= 10
    if(b % 10 == 3):
        print i,

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
n = int(input())

i = 1
while i <= n:
    if (i % 3) == 0:
        print(" {:d}".format(i),end="")
    elif (i % 10) == 3:
        print(" {:d}".format(i),end="")
    i += 1
print("")

Submission status: Wrong Answer

Solution code:
n = int(input())

i = 1
while i <= n:
    x = i
    if x % 3 == 0:
        print(" {:d}".format(i),end="")
    else:
        while x:
            if x % 10 == 3:
                print(" {:d}".format(i),end="")
            x = x // 10
    i += 1
print("")

Submission status: Wrong Answer

Solution code:
a = int(input())

i = 1

while True:
    x = i
    if x % 3 == 0:
        print(" {i}".format(i=i))
    else:
        while True:
            if x % 10 == 3:
                print(" {i}".format(i=i))
            x = x // 10
            if x == 0:
                break
    i += 1
    if i > a:
        break

print('')

Submission status: Wrong Answer

Solution code:
a = int(input())

res = ''

i = 1
while True:
    x = i
    if x % 3 == 0:
        res += " " + str(i)
    else:
        while True:
            if x % 10 == 3:
                res += " " + str(i)
            x = x // 10
            if x == 0:
                break
    i += 1
    if i > a:
        break

print(res)

Submission status: Wrong Answer

Solution code:
def call(n):
    ret = ""
    for i in range(int(n)):
        if 0 == i % 3:
            ret += " " + str(i)
        elif -1 != str(i).find("3"):
            ret += " " + str(i)

    return ret

if __name__ == "__main__":
    n = input()
    ret = call(n)
    print (ret)

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = ""
for i in range(1, n+1):
    if (i % 3 == 0):
        ans += " {}".format(i)

    elif (i % 10 == 3):
        ans += " {}".format(i)
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
result = []
for i in range(1, n+1):
    if i % 3 == 0:
        result.append(i)
    elif (i - 3) % 10 == 0:
        result.append(i)
print(" " + " ".join(map(str, result)))

Submission status: Wrong Answer

Solution code:
m = int(input())
for i in range(1, m+1):
    if i % 3 == 0 or i % 10 == 3:
        print (" " + str(i), end="")
print ("")

Submission status: Wrong Answer

Solution code:
#coding: utf-8

n = int(input())

for i in range(1, n+1):
    if i % 3 == 0:
        print(" " + str(i), end = '')
    elif i % 10 == 3:
        print(" " + str(i), end = '')
print("")

Submission status: Wrong Answer

Solution code:
#coding: utf-8

def func(x):
    if x % 10 == 3:
        print(" " + str(x), end = '')
    else:
        x /= 10
        if x:
            func(x)

n = int(input())

for i in range(1, n+1):
    x = i
    if x % 3 == 0:
        print(" " + str(x), end = '')
        continue
    
    func(x)
print("")

Submission status: Wrong Answer

Solution code:
#coding: utf-8

n = int(input())

for i in range(1, n+1):
    x = i
    if x % 3 == 0:
        print(" " + str(x), end = '')
        continue

    for j in range(1,6):
        if int(x / (10**j)) % 10 == 3:
            print(" " + str(x), end = '')
            break
print("")

Submission status: Wrong Answer

Solution code:

n=int(input())

for i in range(n):
    if i % 3 == 0 or i//10 == 3 :
        print(str(i) + " ")

Submission status: Wrong Answer

Solution code:

for i in range(30):
    if (i+1) % 3 == 0 or "3" in str(i+1) :
        print(str(i) + " ")

Submission status: Wrong Answer

Solution code:
n=int(input())
for i in range(30):
    if (i+1) % 3 == 0 or "3" in str(i+1) :
        print(str(i) + " ")

Submission status: Wrong Answer

Solution code:

n=int(input())
for i in range(n):
    if (i+1) % 3 == 0 or "3" in str(i+1) :
        print(str(i) + " ")

Submission status: Wrong Answer

Solution code:

n=int(input())
for i in range(n):
    if (i+1) % 3 == 0 or "3" in str(i+1) :
        print(str(i+1) + " ")

Submission status: Wrong Answer

Solution code:
n = int(input())
i = 1
a = ''
while i <= n:
    if i % 3 == 0:
        a += ' ' + str(i)
    if i % 10 == 3:
        a += ' ' + str(i)
    i += 1
print(a)

Submission status: Wrong Answer

Solution code:
n = int(input())
i = 1
a = ''
while i <= n:
    if i % 3 == 0:
        a += ' ' + str(i)
    elif i % 10 == 3:
        a += ' ' + str(i)
    i += 1
print(a)