class Solution {
public:
int getSum(int n) {
return 1ll*n*(n+1)/2;
}
};
相关文章
- 11-10剑指offer第九天-2.求1+2+…+n
- 11-10剑指Offer-求1+2+3+...+n
- 11-10剑指offer 47. 求1 + 2 + 3 + .... + n
- 11-10剑指offer[47]——求1+2+3+...+n
- 11-10Leetcode-剑指 Offer 64. 求1+2+…+n
- 11-10LeetCode 剑指offer 面试题64. 求1+2+…+n
- 11-10【剑指offer】剑指 Offer 64. 求1+2+…+n
- 11-10Day19:剑指 Offer 64. 求1+2+…+n
- 11-10#力扣 LeetCode剑指 Offer 64. 求1+2+…+n @FDDLC
- 11-10剑指offer64:求1+2+...+n