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(raw_input())

output = ""
for x in range(1, n + 1):
  while True:
    if x % 3 == 0 or x % 10 == 3:
      output += " "
      output += str(x)
      break
    else:
      x /= 10
      if x == 0:
        break
print output

Submission status: Wrong Answer

Solution code:
n = int(raw_input())

output = ""
for i in range(1, n + 1):
  x = i
  while True:
    if x % 3 == 0 or x % 10 == 3:
      output += " "
      output += str(i)
      break
    else:
      x /= 10
      if x == 0:
        break
print output

Submission status: Wrong Answer

Solution code:
n = int(raw_input())

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

  while True:
    if x % 10 == 3:
      output += " "
      output += str(i)
      break
    else:
      x /= 10
      if x == 0:
        break
print output

Submission status: Wrong Answer

Solution code:
a=int(raw_input())
b=[i for i in xrange(a+1) if i%3==0]
print "",
for i in b[1:-1]:
	print i,
print b[-1]

Submission status: Wrong Answer

Solution code:
a=int(raw_input())
b=[i for i in xrange(a+1) if i%3==0 or i%10==3]
print "",
for i in b[1:-1]:
	print i,
print b[-1]

Submission status: Wrong Answer

Solution code:
n=input()
print ""
for i in xrange(1,n+1):
	if i%3==0 or str(i).count('3'):
		print i

Submission status: Wrong Answer

Solution code:
i = int(input())

for j in range(1, i + 1) :

    if j % 3 == 0 :
        print(' {}'.format(j), end = '')
    elif j % 10 == 3 :
        print(' {}'.format(j), end = '')
print()

Submission status: Wrong Answer

Solution code:
i = int(input())

for j in range(1, i + 1) :
    if j % 3 == 0 :
        print(' {}'.format(j), end = '')
    elif (j % 10 == 3) :
        print(' {}'.format(j), end = '')
    elif (int(j / 10) % 10 == 3) :
        print(' {}'.format(j), end = '')
print()

Submission status: Wrong Answer

Solution code:
n = int(input())

numbers = ""

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

print(numbers)

Submission status: Wrong Answer

Solution code:
n = input()
x = 1
print '',
while True:
    if x > n:
        break
    elif (x % 3 == 0) or (x % 10 == 3):
        print x,
    x += 1

Submission status: Wrong Answer

Solution code:
n = input()
x = 1
print '',
while True:
    if x > n:
        break
    if (x % 3 == 0) or (x % 10 == 3):
        print x,
    x += 1

Submission status: Wrong Answer

Solution code:
n = input()
x = 1
print '',
while True:
    if x > n:
        break
    if x % 3 == 0:
        print x,
    elif x % 10 == 3:
        print x,
    x += 1

Submission status: Wrong Answer

Solution code:
import sys

n = input()
for i in range(1,n+1) :
	if i%3==0 :
		print' ',
		sys.stdout.write(str(i))
	elif(i%10==3):
		print' ',
		sys.stdout.write(str(i))
print''

Submission status: Wrong Answer

Solution code:
num = input()
print " ",
for x in xrange(num+1):
    if x%3==0:
        print x,
    elif str(x)[-1]=="3":
        print x,
    else:
        pass

Submission status: Wrong Answer

Solution code:
num = input()
print "",
for x in xrange(1,num+1):
    if x%3==0:
        print x,
    elif str(x)[-1]=="3":
        print x,
    else:
        pass

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=input()
print "",
for i in range(1, n+1):
  if i%3==0 or str(i)[:-1].find("3")!=-1:
    print "{}".format(i),

Submission status: Wrong Answer

Solution code:
import sys
n = input()
for i in range(1, n + 1) :
    if (i % 3 == 0 or i % 10 == 3) :
        sys.stdout.write(" %d" % (i))
print("")

Submission status: Wrong Answer

Solution code:
n = int(raw_input())
out_str = ""
for i in range(1,n+1):
    x = i
    if x % 3 == 0:
        out_str += " " + str(i)
        continue
    while x:
        if x % 10 == 0:
            out_str += " " + str(i)
            break
        x /= 10
print out_str

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys

n = int( sys.stdin.readline() )
print n

i = 0
while i < n:
    i = i+1
    x = i
    if x%3 == 0:
        print " " + str(i),
        continue
    if str(x).find( "3") > -1:
        print " " + str(i),
        continue
print

sys.exit(0)

Submission status: Wrong Answer

Solution code:
# coding:utf-8

import sys

# ??\???
n = int(input())

display = []
for i in range(n):
    num = i + 1
    # 3??§?????????????????´???
    if (num % 3 == 0):
        display.append(num)
        continue

    # ????????????????????????3????????????????????´???
    while (num != 0):
        last_digit = int(num % 10)
        if (last_digit == 3):
            display.append(num)
            num = 0
        num = int(num / 10)

for x in display:
    
    sys.stdout.write(' ' + str(x))
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(' ' + str(i), end='')
print()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = input()
s = ''
for i in xrange(1, n + 1):
    if (i % 3 == 0):
        s = s + ' ' + str(i)
    elif (i % 10 == 3):
        s = s + ' ' + str(i)
print s

Submission status: Wrong Answer

Solution code:
n = int(raw_input())

for i in range(n):
  if i%3 == 0:
    print "%d" %(i)
  elif i%3 == 3:
    print "%d" %(i)

Submission status: Wrong Answer

Solution code:
import math
n = input()
s = ''
for i in xrange(1, n + 1):
    if (i % 3 == 0):
        s = s + ' ' + str(i)
    else:
        for j in xrange(int(math.log10(i))):
            if (int(i / pow(10, j)) % 10 == 3):
                s = s + ' ' + str(i)
print s

Submission status: Wrong Answer

Solution code:
import math
n = input()
s = ''
for i in xrange(1, n + 1):
    if (i % 3 == 0):
        s = s + ' ' + str(i)
    else:
        for j in xrange(int(math.log10(i))):
            if (int(i / pow(10, j)) % 10 == 3):
                s = s + ' ' + str(i)
                break
print s

Submission status: Wrong Answer

Solution code:
n = int(raw_input())

for i in range(n):
  if i%3 == 0:
    print ("{0}".format(i))
  elif i%3 == 3:
    print ("{0}".format(i))

Submission status: Wrong Answer

Solution code:
n = int(raw_input())

for i in range(n+1):
  if i%3 == 0:
    print ("{0}".format(i))
  elif i%3 == 3:
    print ("{0}".format(i))
  else:
    i += 1

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys

n = input()

tmp1 = 3

while tmp1 <= n:
    if tmp1 % 3 == 0:
        string =  ' ' + str(tmp1)
        sys.stdout.write(string )
    else:
        tmp2 = tmp1
        while tmp2 > 0:
            tmp2 /= 10
            if tmp2 == 3:
                string = ' ' + str(tmp1)
                sys.stdout.write(string)
                break
    tmp1 += 1

Submission status: Wrong Answer

Solution code:
n = input()
list = range(n/10, n+1, n/10)
print '',
for i in range(len(list)):
	print list[i],

Submission status: Wrong Answer

Solution code:
n = input()
list = range(n/10, n+1, n/10)
print '',
for i in range(len(list)):
	print list[i],
print ''

Submission status: Wrong Answer

Solution code:
n=input()
print "",
for i in xrange(1,n+1):
    if i%3==0:
        print i,

Submission status: Wrong Answer

Solution code:
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:
n = input()
x = 1
print ''
while True:
    if x > n:
        break
    if (x % 3 == 0) or ('3' in str(x)):
        print 'x'

    x =x + 1

Submission status: Wrong Answer

Solution code:
n = input()
x = 1
print ''
while True:
    if x > n:
        break
    if (x % 3 == 0) or ('3' in str(x)):
        print x

    x =x + 1

Submission status: Wrong Answer

Solution code:
n = input()
x = 1
print ''

while True:
    if x > n:
        break
    if (x % 3 == 0) or ('3' in str(x)):
        print x
    x =x + 1

Submission status: Wrong Answer

Solution code:
n = input()

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

Submission status: Wrong Answer

Solution code:
n = input()
print ""
 
for i in range(1, n+1):
   if n%i == 0:
      print "%d "%(i)

Submission status: Wrong Answer

Solution code:
n = input()
 
for i in range(1, n+1):
   if n%i == 0:
      print " %d"%(i)

Submission status: Wrong Answer

Solution code:
n = input()
  
for i in range(1, n+1):
   if i%3 == 0:
      print " %d"%(i)

Submission status: Wrong Answer

Solution code:
n = input()
print ""

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = input()

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

Submission status: Wrong Answer

Solution code:

n = input()


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

Submission status: Wrong Answer

Solution code:

n = input()
print"",

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

Submission status: Wrong Answer

Solution code:
def check(a,x):
    if x == 3 :
        print a,
    elif x :
        check(a,x/10)
        
        
n = input()
print"",

for i in range(3,n+1) :
    if i % 3 == 0 :
        print i ,
    elif i%10 == 3 :
        print i,
    else :
        check(i,i/10)

Submission status: Wrong Answer

Solution code:
n = input()

for i in range(1, n/3):
    print " %d" %(i*3),

Submission status: Wrong Answer

Solution code:
n = input()

print "",

for i in range(1, n/3+1):
    print "%d" %(i*3),

Submission status: Wrong Answer

Solution code:
n = input()

print "",

for i in range(1, n/3+1):
    print "%d" %(i*3),

if n%3 == 1:
    print n
if n%3 == 2:
    print n-1, n

Submission status: Wrong Answer

Solution code:
n = input()

print "",

if n <= 30:
    for i in range(1, n/3+1):
        print "%d" %(i*3),

if n >  30:
    for i in range(1, 11):
        print "%d" %(i*3),
    for i in range(31, n+1):
        print i,

Submission status: Wrong Answer

Solution code:
n = input()
i = 1
print "",

while True:
    if i/10 == 3:
        print i,
    elif i%3 == 0:
        print i,
    elif i%10 == 3:
        print i,
    if i == n:
        break
    i = i + 1

Submission status: Wrong Answer

Solution code:
n = input()
x = 1
print ''
while 1:
  if x > n:
     break
  if ( x % 3 == 0 ) or ( '3' in str(x) ):
     print x
  x += 1

Submission status: Wrong Answer

Solution code:
n = input()
x = 1
print ''
while 1:
  if x > n:
     break
  if ( x % 3 == 0 ) or ( '3' in str(x) ):
     print (x)
  x += 1

Submission status: Wrong Answer

Solution code:
n = input()
x = 1
print ''
while True:
  if x > n:
     break
  if ( x % 3 == 0 ) or ( '3' in str(x) ):
     print (x)
  x += 1

Submission status: Wrong Answer

Solution code:
n = input()
for i in range(n):
  if i%3==0 or i%10==3:
    print ' %d' % i

Submission status: Wrong Answer

Solution code:
n = input()
x = 1
ans = 0
while 1:
  if x > n:
     break
  if ( x % 3 == 0 ) or ( '3' in str(x) ):
     ans = ans + x
  x += 1
print ans

Submission status: Wrong Answer

Solution code:
n = input()
x = 1
ans = 1
while 1:
  if x > n:
     break
  if ( x % 3 == 0 ) or ( '3' in str(x) ):
     ans = ans + x
  x += 1
print ans

Submission status: Wrong Answer

Solution code:
n = input()
x = 1
ans = -1
while 1:
  if x > n:
     break
  if ( x % 3 == 0 ) or ( '3' in str(x) ):
     ans = ans + x
  x += 1
print ans

Submission status: Wrong Answer

Solution code:
n = input()
x = 0
ans = 0
while 1:
  if x > n:
     break
  if ( x % 3 == 0 ) or ( '3' in str(x) ):
     ans = ans + x
  x += 1
print ans

Submission status: Wrong Answer

Solution code:
n = input()
x = 1
ans = ''
while 1:
  if x > n:
     break
  if ( x % 3 == 0 ) or ( '3' in str(x) ):
     ans = ' ' + str(x)
  x += 1
print ans

Submission status: Wrong Answer

Solution code:
n = input()
for i in range(n):
  x = i
  if x%3==0:
    print ' %d' % x
  while x<=n:
    if x%10==3:
      print ' %d' % x
      break
    else:
      x /= 10
      if x==0:
        break

Submission status: Wrong Answer

Solution code:
n = input()
for i in range(1,n):
  x = i
  if x%3==0:
    print ' %d' % x
  while x<=n:
    if x%10==3:
      print ' %d' % x
      break
    else:
      x /= 10
      if x==0:
        break

Submission status: Wrong Answer

Solution code:
n = int(raw_input())
s = ''

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

Submission status: Wrong Answer

Solution code:
n = input()
for i in range(1,n):
  x = i
  if x%3==0:
    print ' %d' % x
  elif x<=n:
    if x%10==3:
      print ' %d' % x
      break
    else:
      x /= 10
      if x==0:
        break

Submission status: Wrong Answer

Solution code:
n = input()
for i in range(1,n+1):
  x = i
  if x%3==0:
    print ' %d' % x
  elif x<=n:
    if x%10==3:
      print ' %d' % x
      break
    else:
      x /= 10
      if x==0:
        break

Submission status: Wrong Answer

Solution code:
n = input()
for i in range(1,n+1):
  x = i
  if x%3==0:
    print ' %d' % x
    continue
  elif x<=n:
    if x%10==3:
      print ' %d' % x
      break
    else:
      x /= 10
      if x==0:
        break

Submission status: Wrong Answer

Solution code:
n = input()
for i in range(1,n):
  x = i
  if x%3==0:
    print ' %d' % x
    continue
  elif x<=n:
    if x%10==3:
      print ' %d' % x
      break
    else:
      x /= 10
      if x==0:
        break

Submission status: Wrong Answer

Solution code:
n = input()
for i in range(1,n+1):
  x = i
  if x%3==0:
    print ' %d' % x,
    continue
  elif x<=n:
    if x%10==3:
      print ' %d' % x,
      break
    else:
      x /= 10
      if x==0:
        break

Submission status: Wrong Answer

Solution code:
import sys
n = input()
for i in range(1,n+1):
  x = i
  if x%3==0:
    sys.stdout.write(' %d' % x)
    continue
  elif x<=n:
    if x%10==3:
      sys.stdout.write(' %d' % x)
      break
    else:
      x /= 10
      if x==0:
        break

Submission status: Wrong Answer

Solution code:
import sys
n = input()
for i in range(1,n+1):
  x = i
  if x%3==0:
    sys.stdout.write(' %d' % x)
    continue
  while x<=n:
    if x%10==3:
      sys.stdout.write(' %d' % x)
      break
    else:
      x /= 10
      if x==0:
        break
print ''

Submission status: Wrong Answer

Solution code:
import sys
n = input()
for i in range(1,n+1):
  x = i
  if x%3==0:
    sys.stdout.write(' %d' % x)
    continue
  while x<=n:
    if x%10==3:
      sys.stdout.write(' %d' % x)
      break
    else:
      x /= 10
      if x==0:
        break
sys.stdout.write('\n')

Submission status: Wrong Answer

Solution code:
n = int(raw_input())
i = 1
print "",
for i in range(1,n+1):
    x = i
    if x%3 == 0:
        print "%d" %i ,
    elif x%10 == 3:
        print "%d" %i ,

Submission status: Wrong Answer

Solution code:
n = int(raw_input())
i = 1
print "",
for i in range(1,n+1):
    x = i
    if x%3 == 0:
        print "%d" %i ,
    elif x%10 == 3:
        print "%d" %i ,
    elif x/10 == 3:
        print "%d" %i ,

Submission status: Wrong Answer

Solution code:
n = int(raw_input())
i = 1
print "",
for i in range(1,n+1):
    x = i
    if x%3 == 0:
        print "%d" %i ,
    elif x%10 == 3:
        print "%d" %i ,
    else:
        while x != 0:
            x = x/10
            if x % 10 == 3:
                print "%d" %i ,

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(" {0}", end='')
print('\n', end='')

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(" {0}".format(i), end='')
print('\n', end='')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = input()
for x in xrange(1,n+1):
    if x % 3 == 0:
        print (" %d" %(x))

    elif x % 10 == 3:
        print (" %d" %(x))
        while x :
            x /= 10
            if x % 10 == 3:
                print (" %d"%(x))

Submission status: Wrong Answer

Solution code:
n = input()
result = ""
for x in xrange(1,n+1):
    if x % 3 == 0:
        result = result + " " + str(x)

    elif x % 10 == 3:
        result = result + " " + str(x)
        while x :
            x /= 10
            if x % 10 == 3:
                result = result + " " + str(x)

print result

Submission status: Wrong Answer

Solution code:
n = input()
result = ""
for x in xrange(1,n+1):
    if x % 3 == 0:
        result = result + " " + str(x)

    elif x % 10 == 3:
        result = result + " " + str(x)

    else :
        i = x
        while i :
            i /= 10
            if i % 10 == 3:
                result = result + " " + str(x)

print result

Submission status: Wrong Answer

Solution code:
n = int(input())
s = [str(x) for x in range(1, n+1) if (not (x % 3) or not (x % 10 -3))]
print(' '+' '.join(s))

Submission status: Wrong Answer

Solution code:
n = int(input())
s = [str(x) for x in range(1, n+1) if (not (x % 3) or not (x % 10 -3) or not (x // 10 % 10 - 3))]
print(' '+' '.join(s))

Submission status: Wrong Answer

Solution code:
# encoding:utf-8
n = int(input())
result = ''

for i in range(n + 1):
    if (i % 3) == 0 and i != 0:
        result += (str(i) + ' ')

result = result[:len(result) -1]
print(result)

Submission status: Wrong Answer

Solution code:
# encoding:utf-8
n = int(input())
result = ' '

for i in range(n + 1):
    if ((i % 3) == 0 or (i % 10) ==3) and i != 0:
        result += (str(i) + ' ')

result = result[:len(result) -1]
print(result)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
class StructuredProgramming:
    def call(self, n):
        i = 1
        while i <= n:
            x = i
            if x % 3 == 0:
                print " %d" % (i)
            else:
                while x:
                    if x % 10 == 3:
                        print " %d" % (i)
                        break
                    x /= 10
            i += 1
        print

if __name__ == "__main__":
    sp = StructuredProgramming()
    n = int(raw_input())
    sp.call(n)

Submission status: Wrong Answer

Solution code:
n = input()
lst = []
for i in range(3,n+1):
	if i%3==0:
		lst.append(i)
	elif i%10==3:
		lst.append(i)
print lst

Submission status: Wrong Answer

Solution code:
n = input()
lst = []
for i in range(3,n+1):
	if i%3==0:
		lst.append(i)
	elif i%10==3:
		lst.append(i)
print " "
print lst

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for i in range(1,n+1):
    if i%3==0 or i%10==3:
        print(" {0}".format(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 or i//10==3:
        print(" {0}".format(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 or i%10==3 or  i//10==3:
        print(" {0}".format(i),end='')
print()

Submission status: Wrong Answer

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

def check(x):
        if x%3==0 or x%10==3 or  x//10==3:
            print(" {0}".format(x),end='')
        elif x >= 100:
            y=x//10
            if y%3==0 or y%10==3 or  y//10==3:
                print(" {0}".format(x),end='')
for i in range(1,n+1):
    check(i)
print()

Submission status: Wrong Answer

Solution code:
n = int(raw_input())
count = ""

for i in range(1,n+1):
	x = i

	if (x%3) == 0:
		count = count + " " + str(x)
		continue

	while x > 0:
		if (x%10) == 3:
			count = count + " " + str(x)
		x /= 10

print count

Submission status: Wrong Answer

Solution code:
n = int(raw_input())
cout = ""

for i in range(1,n+1):
	x = i

	if (x%3) == 0:
		cout = cout + " " + str(i)
		continue

	while x > 0:
		if (x%10) == 3:
			cout = cout + " " + str(i)
		x /= 10

print cout

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
def main():
	num = int(input())
	res = " "
	for i in range(1, num + 1):
		if i % 3 == 0:
			res += str(i) + " "
	print(res)
	return
if __name__ == '__main__':
  main()

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
def main():
	num = int(input())
	res = ""
	for i in range(1, num + 1):
		if i % 3 == 0:
			res += " "+str(i)
	print(res)
	return
if __name__ == '__main__':
  main()

Submission status: Wrong Answer

Solution code:
import sys
import math

n = input()

for x in xrange(1, n+1) :
    if x%3==0 or x%10==3 :
        sys.stdout.write(' ' + str(x))

print

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
num = int(input())
print(' '.join([str(i) for i in range(1,num+1) if i % 3 == 0]))

Submission status: Wrong Answer

Solution code:
num = int(input())
print(' ' + ' '.join([str(i) for i in range(1,num+1) if i % 3 == 0]))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
o = ""
for i in range(1, n+1):
    if (i % 3) == 0:
        o = o + " " + str(i)
        continue
    if(i % 10) == 3:
        o = o + " " + str(i)

print(o)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8
num = int(input())
i = 0
while (i != num):
    i+=1
    if i % 3 == 0:
        print(i)
    elif "3" in str(i):
        print(i)

Submission status: Wrong Answer

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

print(ans)

Submission status: Wrong Answer

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

print(ans)

Submission status: Wrong Answer

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

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(" %d" % (i),end="")

print()

Submission status: Wrong Answer

Solution code:
def call(n):
    s = ""
    for x in range(1, n + 1):
        y = x
        if y % 3 == 0:
            s = s + " " + str(x)
        else:
            while y != 0:
                if y % 10 == 3:
                    s = s + " " + str(x)
                y = int(y / 10)
    return s

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

Submission status: Wrong Answer

Solution code:
i = input()
if 3 < i < 10000:
        for n in xrange(1,i+1):
                if n%3==0 or "3" in  str(n):
                        print n

Submission status: Wrong Answer

Solution code:
x = int(input())
for i in range(1,30+1):
    if i%3 ==0:
        print(' ',i,end='',sep='')
    elif i%10 ==3:
        print(' ',i,end='',sep='')
print()

Submission status: Wrong Answer

Solution code:
x = int(input())
for i in range(1,30+1):
    if i%3 ==0:
        print(' ',i,end='',sep='')
    elif i%10 ==3:
        print(' ',i,end='',sep='')
print('')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
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:
n = int(input())
L = []

for x in range(3,n+1):
    if x % 3 == 0:
        L.append(x)
    elif x / 10 == 3:
        L.append(x)
    elif x / 100 == 3:
        L.append(x)
    elif x / 1000 == 3:
        L.append(x)

print "",

while L != []:
    print L.pop(0),

Submission status: Wrong Answer

Solution code:
n = int(input())
L = []

for x in range(3,n+1):
    if x % 3 == 0:
        L.append(x)
    elif x % 10 == 3:
        L.append(x)
    elif x / 10 == 3:
        L.append(x)
    elif x / 100 == 3:
        L.append(x)
    elif x / 1000 == 3:
        L.append(x)

print "",

while L != []:
    print L.pop(0),

Submission status: Wrong Answer

Solution code:
n = int(raw_input())
i = 1
print "",

while i <= n:
  if i%3 == 0:
      print i,
  else:
      I = str(i)
      for j in range(len(I)):
          if I[j] == '3':
              print I,
  i += 1

Submission status: Wrong Answer

Solution code:
n = int(input())

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

Submission status: Wrong Answer

Solution code:
N = int(input())
Plist = []
i=1
print(" ",end="")
while i <= N:
    if i%3 == 0:
        Plist.append(i)
    elif i//10 == 3:
        Plist.append(i)
    elif i%10 == 3:
        Plist.append(i)
    i=i+1
print(" ".join(map(str, Plist)))

Submission status: Wrong Answer

Solution code:
#coding:utf-8
#3????????°???????????????

n = input()

for i in xrange(1, n+1):
    if i % 3 == 0:
        print i,

Submission status: Wrong Answer

Solution code:
#coding:utf-8
#3????????°???????????????

n = input()

print "",
for i in xrange(1, n+1):
    if i % 3 == 0:
        print i,
    elif i % 10 == 3:
        print i,

Submission status: Wrong Answer

Solution code:
#coding:utf-8
#3????????°???????????????

n = input()

print "",
for i in xrange(1, n+1):
    if i % 3 == 0:
        print i,
    elif i % 10 == 3:
        print i,
    elif (i / 10) % 10 == 3:
        print i,