class Solution {
public:
int Sum_Solution(int n) {
return n * (n + 1) / 2;
}
};
剑指Offer_编程题 | 求1+2+3+...+n
最新推荐文章于 2024-05-29 16:14:19 发布
class Solution {
public:
int Sum_Solution(int n) {
return n * (n + 1) / 2;
}
};