题目链接:https://projecteuler.net/problem=6
按题意模拟即可
代码:
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
//freopen("in.txt","r",stdin);
//freopen("out.txt","w",stdout);
ll A=0,B=0;
for(int i=1;i<=100;i++)
{
A+=1LL*i*i;
B+=i;
}
B*=B;
printf("%lld\n",B-A);
return 0;
}