题解 | #表示数字#
表示数字
https://www.nowcoder.com/practice/637062df51674de8ba464e792d1a0ac6
while True:
try:
s = input()
n = len(s)
i = 0
res = []
while i < n:
if s[i].isdigit():
res.append('*')
temp = ''
while i<n and s[i].isdigit():
temp += s[i]
i += 1
res.append(temp)
res.append('*')
else:
res.append(s[i])
i += 1
print(''.join(res))
except:
break

查看29道真题和解析