int i = 1; int sum = 0; class Sum { public: Sum() { sum += i; ++i; } }; class Solution { public: int Sum_Solution(int n) { Sum a[n]; //调用n次sum的构造函数 return sum; } };