Skip to content

Instantly share code, notes, and snippets.

@frank4565
Created May 15, 2013 09:38
Show Gist options
  • Save frank4565/5582790 to your computer and use it in GitHub Desktop.
Save frank4565/5582790 to your computer and use it in GitHub Desktop.
输入一个数x,不采用加号或减号,返回x+1的值(微软实习生面试)
(x & 1) ? (x << 1 | 1) & ~x : (x | 1);
// by 烧掉回忆 http://www.dewen.org/q/12697#ans23348
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment