维基百科代码?任何人都可以查看和编辑代码的地方?

发布于 2024-12-26 05:31:04 字数 239 浏览 2 评论 0原文

是否有一个网站允许任何人查看和编辑算法的实现(Python、C++ 等)?

例如,有一个名为“帕斯卡三角”的页面。下面的内容展示了如何用Python实现帕斯卡三角形的代码。它还显示函数参数为 5 时的输出。

控制台:

>>> pascal_triangle(5)
[1]
[1, 1]
[1, 2, 1]
[1, 3, 3, 1]
[1, 4, 6, 4, 1]

Is there a website that allows anybody to view and edit implementations (in Python, C++, etc.) of algorithms?

For example, there is a page called Pascal's Triangle. The content below shows the code of how to implement Pascal's Triangle in Python. It also shows the output when the function has a parameter of 5.

Console:

>>> pascal_triangle(5)
[1]
[1, 1]
[1, 2, 1]
[1, 3, 3, 1]
[1, 4, 6, 4, 1]

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

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

发布评论

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

评论(2

〃温暖了心ぐ 2025-01-02 05:31:04

我不完全确定,因为这不是一个编程问题,但没有标记。不过,为了回答您的问题,可能适合您目的的网站是 algorithmist ?它非常有用,但如果我没记错的话,它重点关注 C++ 和 C。我不确定有多少页面有实现——许多页面也关注 UVa 问题,并且有解决问题的实现,而不是纯粹的算法。

I'm not entirely sure, since this isn't a programming question, but no flagging. Still, in answer to your question, a possible site that might suit your purposes would be algorithmist? It's pretty useful, but it has a focus on C++ and C if I recall correctly. I'm not sure how many pages have implementations on them -- many of the pages also focus on UVa problems and have implementations that solve problems, rather than being purely algorithmic.

給妳壹絲溫柔 2025-01-02 05:31:04

如果您也想执行代码,请尝试 ideone.com

If you want to execute code, too, try ideone.com.

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