高校计算机

3773考试网计算机等级考试高校计算机正文

java程序设计之24点

来源:fjzsksw.com 2009-11-4 10:50:47

//加的处理

  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] 下一页

触屏版 电脑版
3773考试网 琼ICP备12003406号-1