标签:size bsp cas 题目 off code color case span
【思路】用&&的短路思想来求和
1 class Solution { 2 public: 3 int Sum_Solution(int n) { 4 int sum = n; 5 sum && (sum += Sum_Solution(n - 1)); 6 return sum; 7 } 8 };
标签:size bsp cas 题目 off code color case span
原文地址:http://www.cnblogs.com/lca1826/p/6538621.html