[백준] 5692번 : 팩토리얼 진법 - Python(파이썬)

강재원·2022년 10월 5일
0

[코딩테스트] Python

목록 보기
100/200



https://www.acmicpc.net/problem/5692

from sys import stdin

an=[]
while True:
    a=int(stdin.readline())
    if a==0: break
    count=2
    num=1
    sum=0
    while a>0:
        n=a%10
        sum+=n*num
        a//=10
        num*=count
        count+=1
    an.append(sum)

for i in range(len(an)): print(an[i])
profile
개념정리 & 문법 정리 & 알고리즘 공부

0개의 댓글