我有像(x == y), (t != s), (a = b + c)
这样的字符串。现在,我需要左侧字母x
,t
,a
和正确的字母y
,s
,b
,{{ 1}}。
为此,我正在做以下事情:
c
现在,此代码适用于(a = b + c)等方程式。对于前两个方程,它只返回左手变量(x,t),而不是右手变量(y,s)。
我在这里做错了什么?
非常感谢任何帮助!
答案 0 :(得分:0)
对于初学者: - 第二个getVars(eqn[0]));
必须是getVars(eqn[1]));
while(//{condition}){
eqn = stmnt.split("=");
getVars(eqn[0])); // first while round should return x, then t, and so on.
getVars(eqn[1])); // first while round should return y, then s, then b, c.
}