Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
78340 sh25_wangtaojie 高精度乘低精度 C++ 解答错误 1 MS 248 KB 668 2025-12-26 15:39:38

Tests(1/3):


#include <iostream> #include <string> #include <algorithm> std::string multiply(const std::string& high, int low) { std::string result; int carry = 0; for (int i = high.size() - 1; i >= 0; --i) { int mul = (high[i] - '0') * low + carry; result += (mul % 10 + '0'); carry = mul / 10; } while (carry) { result += (carry % 10 + '0'); carry /= 10; } std::reverse(result.begin(), result.end()); return result; } int main() { std::string high; int low; std::cin >> high >> low; std::cout << multiply(high, low) << std::endl; return 0; }


测评信息: