记录详情

Compile Error

foo.cc: In function 'std::string multiply(const std::string&, const std::string&)':
foo.cc:12:10: error: 'vector' is not a member of 'std'
   12 |     std::vector<int> result(len1 + len2, 0);
      |          ^~~~~~
foo.cc:3:1: note: 'std::vector' is defined in header '<vector>'; did you forget to '#include <vector>'?
    2 | #include <string>
  +++ |+#include <vector>
    3 | // 高精度乘法
foo.cc:12:17: error: expected primary-expression before 'int'
   12 |     std::vector<int> result(len1 + len2, 0);
      |                 ^~~
foo.cc:22:13: error: 'result' was not declared in this scope
   22 |             result[currPos] += product % 10;
      |             ^~~~~~
foo.cc:35:26: error: 'result' was not declared in this scope
   35 |     while (index >= 0 && result[index] == 0) {
      |                          ^~~~~~
foo.cc:40:39: error: 'result' was not declared in this scope
   40 |         finalResult += std::to_string(result[index]);
      |                                       ^~~~~~
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
自测
题目
P1496 Problem 1A. A*B
语言
C++
递交时间
2023-10-03 20:04:40
评测时间
2023-10-03 20:04:40
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes