我晕,绕了一大圈才弄成列表
![[拍砖]](/static/emoticons/u62cdu7816.png)
后面咋整
input = a - b + c - d + e;Total /@ GatherBy[ToExpression[StringReplace[\!\(\*TagBox[StyleBox[RowBox[{"\"\<\>\"", "<>", RowBox[{"ToString", "[", RowBox[{"FullForm", "@", "input"}], "]"}], "<>", "\"\<\>\""}],ShowSpecialCharacters->False,ShowStringCharacters->True,NumberMarks->True],FullForm]\), "Plus" -> "List"]], Head@# == Times &]