Vickeiy @ 2024-12-01 21:11:31
c语言编译的仅供参考
#include<stdio.h>
int main()
{
int k;
int n=1;
long long sum=0;
int cx=0;
int day=1;
scanf("%d",&k);
while(day<=k)
{
if(cx<n)
{
sum+=n;
cx++;
day++;
}
else
{
n++;
cx=0;
}
}
printf("%d",sum);
return 0;
}