haruka0205 @ 2021-08-03 23:48:22
#include<iostream>
#include<cstdio>
using namespace std;
int main(){
int k;
scanf("%d",&k);
int day=1,count=0,i=1;
while(1)
{
for(int j=1;j<=i;j++)
{
count+=i;
if(day==k)break;
day++;
}
if(day==k)break;
i++;
}
printf("%d",count);
return 0;
}
by hsh71667166 @ 2021-08-06 21:18:28
试一下22,你的结果是91,而正常的结果是98;可是你的程序23与正常的结果是105 再改改