- 题目描述
- 结果
#include<iostream>
using namespace std;
int main() {
int sum = 0, psum = 0;
for (int i = 1; i < 101; ++i) {
sum += i;
psum += i * i;
}
cout << sum * sum - psum << endl;
return 0;
}
#include<iostream>
using namespace std;
int main() {
int sum = 0, psum = 0;
for (int i = 1; i < 101; ++i) {
sum += i;
psum += i * i;
}
cout << sum * sum - psum << endl;
return 0;
}