使用“for”批处理文件编程中的循环显示前N个自然数

发布于 2024-09-24 00:36:20 字数 80 浏览 2 评论 0 原文

我想主要了解 for 循环的工作原理。为此,我认为一个小示例程序会对我有所帮助。那么显示前N个自然数的简单程序是什么呢?

I would like to mainly know the working of a for loop. For this I think a small sample program will be helpful to me. So what is a simple program to display the first N natural numbers?

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

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

发布评论

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

评论(1

¢好甜 2024-10-01 00:36:20

如果您在这里谈论 Windows 批处理编程,那么您有一个自然数生成器:

for /L %i IN (0,1,9) do @echo %i

处理文件等的其他有用链接:

如果您正在谈论 GNU Linux/Unix bash 脚本,您可以访问:

希望有帮助,

If you are talking about Windows batch programming here you have a natural numbers generator:

for /L %i IN (0,1,9) do @echo %i

Other helpful links to deal with files and so on:

If you are talking about GNU Linux/Unix bash scripting you can go to:

Hope that helps,

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