stringmultiply(string num1, string num2){ if (num1 == "0" || num2 == "0")return"0"; int len1 = num1.length(); int len2 = num2.length(); int i = len1 + len2 - 2; string res = ""; int c = 0, x = 0; while (i >= 0) { x = c;//c表示上一次的进位 for (int j = i < len1 ? i : (len1 - 1); i - j < len2 && j >= 0; j--) x += ((num1[j] - '0')*(num2[i - j] - '0')); c = x / 10; x = x % 10; res = char('0' + x) + res; i--; } if(c)res = char('0' + c) + res; return res; }