1.递归
2.逻辑与 && (因为不能使用if)
public class Solution { public int Sum_Solution(int n) { boolean q = (n>1 && (n+=Sum_Solution(n-1))>0); return n; } }
1.递归
2.逻辑与 && (因为不能使用if)
public class Solution { public int Sum_Solution(int n) { boolean q = (n>1 && (n+=Sum_Solution(n-1))>0); return n; } }