题解 | #参数解析#
参数解析
http://www.nowcoder.com/practice/668603dc307e4ef4bb07bcd0615ea677
def op(s):
option = ''
while s:
if s[0] != '"':
if s[0] != ' ':
option += s[0]
s = s[1:]
else:
if option:
res.append(option)
s = s[1:]
return op(s)
else:
s = s[1:]
while s[0] != '"':
option += s[0]
s = s[1:]
else:
res.append(option)
s = s[1:]
return op(s)
else:
if option:
res.append(option)
return res
while True:
try:
s1 = input()
s2 = op(s1)
print(len(s2))
for i in s2:
print(i)
except:
break