Переведите на С++( ) source = input('Введите строку: ')
ret = ''
for idx, char in enumerate(source):
try:
next = source[idx + 1]
if char.isdigit() and next.isdigit():
qt = 10 * int(char) + int(next)
next = source[idx + 2]
else:
qt = int(char)
except:
ret += char
else:
ret += next * (qt - 1)
print('ответ:', ret)