//加的处理
if(n > 2)
expression[i] = "(" + expi + "+" + expj + ")";
else
expression[i] = expi + "+" + expj;
number[i] = numi + numj;
if(circule(n-1))
return true;
//减的处理,有两种情况expi-expj,expj-expi
if(n > 2)
expression[i] = '(' + expi + '-' + expj + ')';
else
expression[i] = expi + '-' + expj;
number[i] = numi - numj;
if(circule(n-1))
return true;
if(n > 2)
expression[i] = '(' + expj + '-' + expi + ')';
else
expression[i] = expj + '-' + expi;
number[i] = numj - numi;
if(circule(n-1))
return true;
//乘的处理
expression[i] = expi + "*" + expj;
number[i] = numi * numj;
if(circule(n-1))
return true;
//除的处理,有两种情况expi/expj,expj/expi
if(numj > PRECISION)
{
expression[i] = expi + '/' + expj;
number[i] = numi / numj;
if(circule(n-1))
return true;
}
上一页 [1] [2] [3] [4] 下一页