通俗易懂 通过全部用例

while True:
    try:
        s=input()
        temp,res=[],[]
        for i,x in enumerate(s):
            if x=='"':
                temp.append(i)
        while temp:
            if s[temp[0]:temp[1]].find(' ')!=-1:
                a=s[temp[0]:temp[1]].replace(' ','++++')
                s=s[:temp[0]]+a+s[temp[1]+1:]
            temp.pop(0)
            temp.pop(0)
        res=s.split()
        for j in range(len(res)):
            res[j]=res[j].replace('++++',' ')
            if res[j].find('"')!=-1:
                res[j]=res[j].replace('"','')
        print(len(res))
        for k in res:
            print(k)
    except:
        break