gpt4 book ai didi

c++ - 总是输出 65535 个字符?

转载 作者:太空宇宙 更新时间:2023-11-04 16:00:31 25 4
gpt4 key购买 nike

这是我的代码。

#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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com