題解 | #參數(shù)解析#
參數(shù)解析
http://www.fangfengwang8.cn/practice/668603dc307e4ef4bb07bcd0615ea677
import sys while True: try: a= input().split(' ') n = len(a) cnt =0 b='' c=[] start='"' end ='"' flag =True for i in range(n): if flag: if a[i].startswith(end) and not a[i].endswith(start): flag = not flag b+=a[i] else: c.append(a[i]) cnt+=1 else: if not a[i].startswith(start) and a[i].endswith(end): flag = not flag b+=' '+a[i] c.append(b) cnt+=1 else: b =b+' '+a[i] print(str(cnt)) for i in c: print(i.strip('"')) except: break