题解 | #参数解析#
参数解析
http://www.nowcoder.com/practice/668603dc307e4ef4bb07bcd0615ea677
一步一步调出来的,很笨的方法
s = input()
s +=' '
c = ''
res = []
tmp = 0
for i in range(len(s)):
if s[i]=='"' and s[i+1]!=' ':
idx = s[i+1:].index('"')
tmp = i+1+idx
c = c +s[i+1:i+1+idx]
res.append(c)
c = ''
elif i>=tmp and s[i]!='"':
if s[i]!=' ':
c = c + s[i]
elif c!='' :
res.append(c)
c = ''
# res.append(c)
print(len(res))
for i in res:
print(i)