题解 | #参数解析#
参数解析
http://www.nowcoder.com/practice/668603dc307e4ef4bb07bcd0615ea677
while True:
try:
s = input().split()
l = []
i = 0
while i < len(s):
if s[i][0] != '"':
l.append(s[i])
else:
if s[i][-1] == '"':
l.append(s[i][1:-1])
else:
temp = s[i][1:]
while s[i][-1] != '"':
i += 1
temp += (" " + s[i])
l.append(temp[:-1])
i += 1
print(len(l))
for j in l:
print(j)
except:
break
查看18道真题和解析