문제링크

 

풀이

T = int(input())
for i in range(1, T+1):
    cnt = str(i).count('3') + str(i).count('6') + str(i).count('9')
    if(cnt != 0):
        print('-'*cnt, end=' ')
    else:
        print(i, end=' ')

들어오는 숫자를 문자열로 받아서 3, 6, 9이면 카운트에 포함시키고 카운트 수 만큼 -를 출력한다.