剑指offer题解64. 求 1+2+3+...+n

📅 2026/7/28 18:16:37
剑指offer题解64. 求 1+2+3+...+n
题目描述要求不能使用乘除法、for、while、if、else、switch、case 等关键字及条件判断语句 A ? B : C。题解public class Solution { public int Sum_Solution(int n) { int sum0; boolean b n 1 (sumnSum_Solution(n-1))0; return sum; } }