python解法 标记一下是否是第一次出现
表示数字
http://www.nowcoder.com/questionTerminal/637062df51674de8ba464e792d1a0ac6
encoding:utf-8
if name == 'main':
while True:
try:
s = raw_input()
i= 0
s1 = ''
flag = 1 #第一次出现数字的标记
while i < len(s):
if s[i].isdigit():
if flag:
s1 = s1+''+s[i]
flag = 0
else:
s1 = s1 + s[i]
else:
if not flag:
s1 = s1 +''+s[i]
flag = 1
else:
s1= s1 +s[i]
i = i+1
if s[len(s)-1].isdigit():
s1 = s1+'*'
print s1
except:
break