text=\'A(3)B(1)D(5)C(2)\'
tokens=[]
i=0
while i<len(text):
c=text[i]
if c==\'(\':
i+=1
c=text[i]
value=\'\'
while c!=\')\':
value+=c
i+=1
c=text[i]
tokens.append(int(value))
i+=1
continue
tokens.append(c)
i+=1
output=\'\'
for i in range(len(tokens)//2):
output+=tokens[i*2]*tokens[i*2+1]
print(output)
ㅇ
난 또 위키가 쓴줄알았네
오우 감사합니다 제거 코드는 반복 이상하게 뜨던데 비교해서 알아보겟습니다!!