标签:
//不使用+-*/实现两个数之和 #include <stdio.h> int add(int num1, int num2) { int sum, car; do { sum = num1^num2; car = (num1&num2) >> 1; num1 = sum; num2 = car; } while (num2 != 0); return num1; } int main() { int a = 1; int b = 20; printf("%d\n", add(a, b)); return 0; }
版权声明:本文为博主原创文章,未经博主允许不得转载。
标签:
原文地址:http://blog.csdn.net/doudouwa1234/article/details/46696845