求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
相關文章
相關標籤/搜索