#include<cmath>
#include<cstdio>
#include<iostream>
using namespace std;
int main(){
int i,k,sum;
while(~scanf("%d",&k)){
i=0,sum=0;
k=abs(k);
//前面设置成0的所以
//先加后用
while(++i){
sum+=i;
if(sum>=k&&(sum-k)%2==0){
cout<<i<<endl;
break;
}
}
}
return 0;
}
标签:1120,sum,ZCMU,int,while,include
From: https://www.cnblogs.com/hai-zei/p/18224365