创建一个算法,将字符串中的数字字符按照从大到小的顺序排列。

# 示例
# 输入: hello123world456
# 输出: hello654world321

# 算法实现
input_string = "hello123world456"
number_chars = [char for char in input_string if char.isdigit()]
sorted_numbers = sorted(number_chars, reverse=True)
output_string = input_string
for num in number_chars:
    output_string = output_string.replace(num, sorted_numbers.pop(0), 1)

print(output_string)```