public class ManyBranchTest { private int c; public ManyBranchTest(){ c = 0; } // public void setC(int setC){ // c = setC*3; // } /* public int calc(int a, int b){ System.out.println("----"); if(a >= 0 || b>=0){ System.out.println("1"); a += b; if(a > 3){ System.out.println("2"); a -= c; } return a; } if(a>c){ System.out.println("3"); a += b; } if(b>c){ System.out.println("4"); b *= -1; } if(c<0){ System.out.println("5"); a = b+c; // if(a > 5) // a -= 10; } System.out.println("6"); return a; } */ public int remove(int a, int b){ if(b+a>5){ //System.out.println("0"); a = b; return a; } if(a-b==1){ //System.out.println("1"); a = a+b+2; return a; } if(b-a>2){ //System.out.println("2"); a = a*b+10; return a; } if(a*b<10){ //System.out.println("3"); a = a*b+2; return a; } else{ //System.out.println("4"); a = b+2; } if(a<=0) a = 1; return a; } }