错误:重新定义int main:我编写了一些基本代码,这些代码在Visual Studio上运行良好,但在线IDE上却没有

发布于 2025-02-11 19:42:23 字数 1490 浏览 1 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

赴月观长安 2025-02-18 19:42:23

该网站可能在内部定义自己的main(),并使用它来测试您的提交。通常,这些算法问题网站不需要您实现测试您功能的代码。确实,指令只要求您实现计算函数:

尝试以下编辑器中的以下示例。

创建一个名为“ Compute”的函数,该函数采用两个整数参数A和B,然后返回一个表示A^2 + b^2的整数。

That website likely defines its own main() internally and uses it to test your submission. Typically, these kinds of algorithm question websites don't require you to implement the code that tests your function. Indeed, the instructions only ask you to implement a compute function:

Try the following example in the editor below.

Create a function named “compute” which takes two integer arguments A and B and returns an integer denoting A^2 + B^2.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文