可乐爽 @ 2020-10-13 17:20:12
#include<iostream>
using namespace std;
int a,b,c,ans=0,i=1;
int main()
{
cin>>a;
while(i!=a){
if(a-i>=i)
c=i;
else
c=a-i;
for(int j=1;j<=c;j++){
b++;
if(b<=a)
ans+=i;
}
if(c<=0)
break;
i++;
}
cout<<ans;
return 0;
}
为啥提交后第三个点错了?
by zhangjinyan @ 2020-10-17 21:31:32
因为第3个点是1