Solution to Add Two Numbers from Jobdu

13 Sep

Question (in Chinese): http://ac.jobdu.com/problem.php?pid=1507

Question Name: Add Two Numbers

Question Description: Compute the sum of two integers without addition, subtraction, multiplication and division.

Input: the input might contain multiple test cases. Each line, as a test case, contains two integers N and M (1 <= N, M <= 1000000).

Output: print the sum of N and M.

The solution uses bit operations.

Leave a Reply

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

Please put your code into a <pre>YOUR CODE</pre> section. Thanks and Happy Coding!