| Run ID | 作者 | 问题 | 语言 | 测评结果 | 时间 | 内存 | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 78352 | sh25_wangtaojie | 高精度乘低精度 | C++ | 通过 | 0 MS | 248 KB | 752 | 2025-12-26 15:40:49 |
#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; } while (result.size() > 1 && result.back() == '0') { result.pop_back(); } 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; }