求1+2+3+...+n,要求不能使用乘除法、for、while、if、else、switch、case等关键字及条件判断语句(A?B:C)

代码如下:

public int Sum_Solution(int n) {
        int temp = n;
        boolean b = (temp>0)&&(temp += Sum_Solution(n-1))>0;
        return temp;
    }
原文地址:https://www.cnblogs.com/gaopeng527/p/4781226.html