一 . 直接解题吧spa
芽儿呦,忽然以为,我不说!!code
该题目用到递归,可是却不存在if等判断语句。blog
class Solution { public int Sum_Solution(int n) { // write code here if(n == 1) { return 1; } else { return n + Sum_Solution(n - 1); } } }