https://leetcode-cn.com/problems/qiu-12n-lcof/solution/qiu-12n-by-leetcode-solution/
class Solution {
public:
int sumNums(int n) {
n && (n += sumNums(n-1));
return n;
}
};
https://leetcode-cn.com/problems/qiu-12n-lcof/solution/qiu-12n-by-leetcode-solution/
class Solution {
public:
int sumNums(int n) {
n && (n += sumNums(n-1));
return n;
}
};