我考慮用正則去做,正則寫(xiě)半天沒(méi)寫(xiě)出來(lái),求高人解救測(cè)試規(guī)則如下:simplify("3x+y-x+2y+5xy-y-xy") => 2x+2y+4xysimplify("2xy-yx") =>xysimplify("xzy+zby") =>byz+xyzsimplify("xzy+zby") =>byz+xyzsimplify("y-x")=>-x+y
編寫(xiě)一個(gè)函數(shù),化簡(jiǎn)表達(dá)式(僅限加減法)
喵喵時(shí)光機(jī)
2018-08-14 06:06:52