每日一题3.13.1

每日一题3.13.1 题目描述:编写一个函数实现两个数相加,但不能使用+和其他算术运算符 解题思路: 不使用算术运算符,就使用逻辑运算符来实现,用异或算法 ^ ,来实现,然后考虑进位情况左移一位。 代码实现 #include<iostream> #include<string> using namespace std; class UnusualAdd { public: int addAB(i
相关文章
相关标签/搜索