违规用户名ddc277a @ 2022-03-24 22:08:29
求助一下
#include<bits/stdc++.h>
using namespace std;
int main()
{
int k,ans=0,gold,day=1;
cin>>k;
for(int i=1;i<=k;)
{
gold=day;
for(int j=1;j<=day;j++)
ans+=gold;
day++;
i+=day;
}
cout<<ans<<endl;
return 0;
}