题解 | #参数解析#
参数解析
https://www.nowcoder.com/practice/668603dc307e4ef4bb07bcd0615ea677
while True:
try:
s = input().strip()
len_s = len(s)
lst = []
cmd_lst = []
count = 1
for i in s:
# print(i)
if i == " " and '"' not in lst:
if lst:
cmd_lst.append("".join(str(x) for x in lst))
lst.clear()
elif i == '"' and '"' in lst:
if lst:
cmd_lst.append("".join(str(x) for x in lst[1:]))
lst.clear()
else:
lst.append(i)
if lst:
cmd_lst.append("".join(str(x) for x in lst))
print(len(cmd_lst))
for x in cmd_lst:
print(x)
except:
break


