题目:754. 到达终点数字
class Solution {
public:
typedef long long LL;
int reachNumber(int target) {
int sum=0,n=0;
target=abs(target);
while(sum<target||(sum-target)%2){
sum+=++n;
}
return n;
}
};