-
Line 7: Char 9: runtime error: index 30 out of bounds for type 'int [30]' (solution.cpp) SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior prog_joined.cpp:16:9
数组越界,把int[30]改成int[31] -
C++ requires a type specifier for all declarations dp[0]=0;
翻译:
c++要求所有声明都有类型说明符
没彻底理解,但是知道了解决方法
出错原因: 代码片段没有写在函数中。
解决方法: 将代码片段写进函数中。