JZ47 求1+2+3+...+n 本文最后更新于:2022年4月9日 中午 Solution 12345678class Solution {public: int Sum_Solution(int n) { int sum = n; bool x = (n > 0) && (sum += Sum_Solution(n-1)); return sum; }}; 方法二: 1234567class Solution {public: int Sum_Solution(int n) { bool a[n][n+1]; return sizeof(a) >>1; }}; algo 数学 nowcoder 本博客所有文章除特别声明外,均采用 CC BY-SA 4.0 协议 ,转载请注明出处! JZ48 不用加减乘除做加法 上一篇 JZ46 孩子们的游戏 下一篇 Please enable JavaScript to view the comments powered by Valine.