摘要:
递归阶乘例子: public static long getGactorial(int n){ if(n==1){//递归收敛条件 return 1; } return getGactorial(n-1)*n;} 死递归: public static long getGactorial(int n) 阅读全文
摘要:
条件运算符(三元/三目),条件表达式 条件 ? ① : ② int m=50; int n=20; int a=(m>n)? (m-n) : (n-m) 条件表达式(m>n)为true ;返回 1; 条件表达式(m>n)为false ;返回 2; int a=(50>20)? (m-n) : (n- 阅读全文