这是我的代码。
#include <iostream>
using namespace std;
int main()
{
string s;
cin >> s;
cout << s.length();
return 0;
}
为什么即使我增加了 s 中的字符,它的输出仍为 65535。 我在这里添加了样本输入 https://ideone.com/c2V8YX
最佳答案
Ideone 常见问题解答:
What is the size limit for the source code, input and output?
64 kB.
请注意,此限制与 C++ 语言无关,甚至与它的特定实现无关。限制是由 Ideone 提出的(这是可以理解的。您不希望允许人们上传无限的数据来填满您的服务器)。看起来他们的行为是默默地截断输入。
关于c++ - 总是输出 65535 个字符?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45373402/