← Back to List

4564번: 숫자 카드놀이 ↗

Solutions

Python 3
215 B | 215 chars
while True:
    a=int(input())
    if a==0:
        break
    print(a,end="")
    while a>9:
        S=1
        while(a>0):
            S*=a%10
            a//=10
        print("",S,end="")
        a=S
    print()