PAT中:
error: ‘gets’ was not declared in this scope
            gets(str);

error: ‘gets’ was not declared in this scope      gets(str);
原因:
gets()方法已经不被PAT编译器支持了,因此要采用其他方法。
header添加:
         #include <iostream>
         using namespace std;
将gets(str);改为:
         cin.get(str,n);//n为str数组的长度

相关文章:

  • 2021-12-23
  • 2022-12-23
  • 2021-05-24
  • 2022-12-23
  • 2022-12-23
  • 2021-10-03
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-10
  • 2022-01-16
  • 2021-04-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案