求1+2+3+...+n,要求不能使用乘除法等判断语句

#题目描述 求1+2+3+…+n,要求不能使用乘除法、for、while关键字。 #解题方案 本题的思路是使用递归便可。web public class Solution { public int Sum_Solution(int n) { if(n == 1){ return 1; } return n+Sum_So
相关文章
相关标签/搜索