class Solution { public: int getSum(int n) { //&&来代替if int res = n; n > 0 && (res += getSum(n - 1)); //n > 0 代替if(n > 0) return res; } };