注:这里只是我的代码出现这种情况及对应的解决办法,你的代码不一定出现和我一样的情况。左移这篇随笔仅供参考。

运行程序出现如下结果:

terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc

Process returned 3 (0x3)   execution time : 5.837 s
Press any key to continue.

然后发现是 for 循环里面的,本应写成

for (int j = 1; j <= 3; j ++)

的地方,写成了

for (int j = 1; j <= 3; j --)

改过来就好了。

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-04
  • 2021-04-06
  • 2022-12-23
  • 2021-05-19
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-09-19
  • 2021-06-22
  • 2022-12-23
  • 2022-12-23
  • 2021-12-30
  • 2019-08-30
  • 2022-12-23
相关资源
相似解决方案