题解 | #在字符串中找出连续最长的数字串#
在字符串中找出连续最长的数字串
https://www.nowcoder.com/practice/2c81f88ecd5a4cc395b5308a99afbbec
import re
while True:
try:
out = ''
ps = input()
nl = re.findall('[0-9]+',ps)
ml = max([len(n) for n in nl])
for n in nl:
if len(n)==ml:
out += n
print(','.join([out,str(ml)]))
except:
break
查看17道真题和解析