6730 累计相加

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 1e3+10,inf = 0x3f3f3f3f;
map<ll,ll> ma;
ll n,x;
int main()
{
    cin >> n;
    ll sum = 0;
    for(int i = 1; i <= n; i++)
        for(int j = 1; j <= i; j++)
            sum += j;
    cout << sum;
    return 0;
}

 

posted @ 2024-06-30 22:46  CRt0729  阅读(10)  评论(0编辑  收藏  举报