题解 | #求1+2+3+...+n#
求1+2+3+...+n
https://www.nowcoder.com/practice/7a0da8fc483247ff8800059e12d7caf1
class Solution { public: class sum { public: sum() { _count += _i; ++_i; } }; int Sum_Solution(int n) { sum arr[n]; return _count; } private: static int _i; static int _count; }; int Solution::_i = 1; int Solution::_count = 0;