摘要:
string multiply(string num1, string num2) { if (num1 == "0" || num2 == "0") return "0"; int sa = num1.size(); int sb = num2.size(); vector temp(sa + sb, 0); for (int i = sa - 1; i >= 0;... 阅读全文
摘要:
vector plusOne(vector& digits) { vector res; int carry = 1; for (int i = digits.size() - 1; i >= 0; i--) { int sum = carry + digits[i]; carry = sum / 10; res.push_back(su... 阅读全文
摘要:
#include #include #include #include #include using namespace std;string addBinary(string a, string b) { int carry = 0; int len = a.size() > b.size() ? a.size() : b.size(); string res; for ... 阅读全文