剑指OFFER 求1+2+3+...+n
剑指OFFER 求1+2+3+...+n
呃,这题好像太简单了点...
class Solution {
public:
int Sum_Solution(int n) {
return n*(n+1)/2;
}
};
呃,这题好像太简单了点...
class Solution {
public:
int Sum_Solution(int n) {
return n*(n+1)/2;
}
};