728x90
    
    
  간단한 369 게임
SW Expert Academy
SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요!
swexpertacademy.com
N = int(input())
result = []
for n in range(1, N+1):
    numStr = str(n)
    count = 0
    if numStr.find("3") > -1:
        count += numStr.count("3")
    if numStr.find("6") > -1:
        count += numStr.count("6")
    if numStr.find("9") > -1:
        count += numStr.count("9")
    if count == 0:
        result.append(str(n))
    else:
        result.append("-" * count)
print(' '.join(result))'Algorithm&CodingTest > SW Expert Acardemy' 카테고리의 다른 글
| [SWEA][D2] 2001 파리 퇴치 Python (0) | 2024.01.16 | 
|---|---|
| [SWEA][D1] [2058] 자릿수 더하기 - Python (1) | 2023.05.16 | 
| [SWEA][D1] [2043] 서랍의 비밀번호 - Python (0) | 2023.05.16 | 
| [SWEA][D1] [2025] N줄 덧셈 - Python (0) | 2023.05.16 | 
| [SWEA] [2046] 스탬프 찍기 - python (0) | 2023.05.16 |