- 王赟博 的博客
临时存代码
- @ 2026-10-10 16:32:29
#include <bits/stdc++.h>
using namespace std;
int main()
{
//ios::sync_with_stdio(false);
//cin.tie(nullptr);
//cout.tie(nullp0tr);
int k;
cin >> k;
int cnt = 0;
int i = 1;
while(k)
{
for(int j = 1;j <= i;j++)
{
cnt += i;
k--;
}
i++;
}
cout << cnt << endl;
return 0;
}