June is Combung
369게임[2단계] 본문
# 369게임[2단계]
# 1. 1~50까지 반복을 한다.
# 2. 그 안에서 해당 숫자의 369게임의 결과를 출력한다.
# 예) 1 2 짝 4 5 짝 7 8 짝 10 11 12 짝 ...
i = 1
while(i <= 50):
a = i//10
b = i%10
count = 0
if a%3 == 0 and a!=0:
count += 1
if b%3 == 0 and b!=0:
count += 1
if count == 2:
print("짝짝", end=" ")
elif count == 1:
print("짝", end=" ")
else:
print(i, end=" ")
i += 1
Comments