题解 | #参数解析#
参数解析
http://www.nowcoder.com/practice/668603dc307e4ef4bb07bcd0615ea677
import sys
for line in sys.stdin:
input1 = line.strip()
ll = []
if '"' in input1:
input2 = input1.split('"')
for w in input2:
if w and (w[-1] == " " or w[0] == " "):
for k in w.split(" "):
if k:
ll.append(k)
elif w:
ll.append(w)
else:
ll = input1.split(" ")
print(len(ll))
print("\n".join(ll))