求1+2+3+...+n
求1+2+3+...+n
https://www.nowcoder.com/practice/7a0da8fc483247ff8800059e12d7caf1?tpId=13&&tqId=11200&rp=1&ru=/ta/coding-interviews&qru=/ta/coding-interviews/question-ranking
递推公式:f(n) = f(n-1) + n
递归终止条件:f(1) = 1
public class Solution { public int Sum_Solution(int n) { if (n == 1) { return 1; } else { return n + Sum_Solution(n-1); } } }