题解 | 表示数字
while True: try: chars = input() charsNew = '' numStart,numEnd = 0,0 while numStart < len(chars): if chars[numStart].isdigit(): temp = '*' # 临时变量保存连续数字和符号 temp += chars[numStart] numEnd = numStart+1 # 初始位置 while numEnd < len(chars): if chars[numEnd].isdigit() : #是数字 temp += chars[numEnd] numEnd += 1 else: #不是数字 break temp += '*' charsNew += temp numStart = numEnd else: charsNew += chars[numStart] numStart += 1 print(charsNew) except: break