题解 | #参数解析#
参数解析
https://www.nowcoder.com/practice/668603dc307e4ef4bb07bcd0615ea677
def xx(a): kk = list(a)[::-1] #逆序pop() ls = [] flag = 0 s = "" while kk: i = kk.pop() if i != '"': s += i else: if flag: #flag=1的时候不需要split() if s: ls.append(s) s = "" flag = 0 else: if s: for i in s.split(): if i: ls.append(i) s = "" flag = 1 if s: #最后别忘了还有字符串没加进来 for i in s.split(): if i: ls.append(i) return ls while True: try: a = input().strip() ls = xx(a) print(len(ls)) for i in ls: print(i) except: break