【解题报告】【lintcode1】A + B Problem

题意

不适用任何数学运算实现A+B

解答

使用位运算
异或运算可以当作加法,但是无法处理进位
需要使用按位与和左移来进行进位处理

代码

u3coding
A software developer

Leave a Comment

Your email address will not be published. Required fields are marked *

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.