ZhangJunyu2011 @ 2024-11-10 11:21:33
#include<bits/stdc++.h>
using namespace std;
int k,ans,day_num;
int main(){
cin>>k;
for(int i=1;;i++){
day_num+=i;
if(day_num<=k){
ans+=i*i;
}
else if(day_num>k){
ans+=(k-(day_num-i))*i;
break;
}
}
cout<<ans;
}
不知道为什么编译错误,求助大佬
by mannnnnnnnnnnnnnnnn @ 2024-11-10 11:28:10
@ZhangJunyu2011
洛谷不会帮你加 return 0;
by ZhangJunyu2011 @ 2024-11-10 11:31:40
我发现是我语言调错了,谢谢