题目描述:
https://leetcode-cn.com/problems/qiu-12n-lcof/
Java代码:
class Solution {
public int sumNums(int n) {
boolean b=n!=0&&(n=n+sumNums(n-1))==0;
return n;
}
}
2024-02-01 09:08:28
题目描述:
https://leetcode-cn.com/problems/qiu-12n-lcof/
Java代码:
class Solution {
public int sumNums(int n) {
boolean b=n!=0&&(n=n+sumNums(n-1))==0;
return n;
}
}