class Solution { public: int getSum(int n) { //短路思想 int res=n; n>0&&(res+=getSum(n-1)); return res; } };