题解 | #参数解析#python | 救出友军,再一举切碎
参数解析
http://www.nowcoder.com/practice/668603dc307e4ef4bb07bcd0615ea677
s=input().strip() loca=[] for i in range(len(s)): if s[i]=='"': loca.append(i) sl=list(s) for i in range(0,len(loca)//2,2): for sp in range(loca[i]+1,loca[i+1]): if sl[sp]==' ': sl[sp]='*any_strange_string*' s2= ''.join(sl) sl2=s2.split() print(len(sl2)) for w in range(len(sl2)): if '*any_strange_string*' in sl2[w]: sl2[w]=sl2[w].replace('*any_strange_string*',' ') print(sl2[w].strip('"'))