字符移动 题解:Python
while True:
try:
str = input()
digit_text = ""
other_text = ""
for char in str:
if char.isdigit():
digit_text += char
else:
other_text += char
text = other_text + digit_text
print(text)
except:
break
#通过isdigit()判断数字并保存为一个字符串
#最后通过text把非数字和数字字符串合并
登录后发布评论
暂无评论,来抢沙发