题目6 题解 一趟遍历,算出结果 #include <iostream> int main(){ int sum = 0, psum = 0; for(int i=1;i<=100;++i){ psum += i*i; sum += i; } std::cout << sum * sum - psum << std::endl; return 0; }