“Hello World”之后您的第一个应用程序是

发布于 2024-11-03 14:26:08 字数 377 浏览 1 评论 0原文

我知道这是一个有点臃肿的问题,但是......学习新语言,你首先写“Hello world”,对吗? :) 你的下一个应用程序是什么?

什么样的应用程序可以引导您完成基础知识?我读了一些编程书籍,通常作者通过编写一些应用程序向您展示编程语言的基础知识和功能。一开始很简单,但后来他们添加了越来越多的功能,总而言之,在本书的结尾,它已经是一个非常有特色的应用程序。我想知道“Hello, world”之后哪个应用程序最适合练习和发现您正在学习的语言。

它可能是这样的:从 stackoverflow 第一页获取所有问题,创建以问题标题命名的文件,并使用每个问题的首字母大写创建目录名称,然后将文本文件放入相应的目录中。毕竟,统计所有目录中的所有文件,并告知创建了多少个文件和目录,并列出每个目录中有多少个文件。

I understand it is kind of bloated question, but.... learning new language, you first write "Hello world", right? :) And what is your next application?

What kind of application would walk you through basics? I read some programming books and usually authors show you the programming language basics and features by writinig some application. It is easy in the beggining but then they add more and more features and all in all it is already a very featured application in the end of the book. I want to know what application after "Hello, world" is the best for practicing and discovering the language you are learning.

It might be something like: get all questions from first page of stackoverflow and create files named by questions titles and create directories names with uppercased first letter of each question and then put your text files in the corresponding directories. After all, count all files in all directories and tell how many files and directories was created and list how many files there are in each directory.

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

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

发布评论

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

评论(3

还给你自由 2024-11-10 14:26:08

Hello World 之后典型的“下一个练习”是教授循环的东西 - 比如打印所有斐波那契数[只要内置数据类型可以处理]或生成墙上 99 瓶啤酒的歌词或圣诞节的 12 天。然后是基本的输入处理(顺便说一句,如果你有一个糟糕的 C 教程,这部分很可能会教你一些你稍后必须忘记的东西,无论是 gets 还是 scanffflush(stdin))

然后稍后你会看到你提到的“应用程序”之类的东西,即添加这个功能并添加那个功能,很快你就得到了一个真实的程序。

The stereotypical 'next exercise' after Hello World is something to teach loops - like printing all the fibonacci numbers [as far as the built in datatypes can handle] or generating the lyrics to 99 bottles of beer on the wall or the 12 days of christmas. Then after that is basic input handling (Incidentally, if you've got a bad C tutorial, this part is most likely to teach you something you will have to unlearn later, whether it's gets or scanf or fflush(stdin))

Then a bit later you get to the 'application' kind of thing you mentioned i.e. add this feature and add that feature and soon enough you've got a real program.

老街孤人 2024-11-10 14:26:08

对于“hello world 之后”程序来说,这有点复杂。下一个程序通常涉及从用户处获取一些输入,然后根据该输入进行分支逻辑。

又名:输入一个数字,然后乘以 2。

它让您习惯输入、输出和清理收到的输入。

That's kinda complex for the "just after hello world" program. The next program usually involves taking some input from the user and then branching logic based on that input.

AKA: Enter a Number and then Multiply by 2.

It gets you used to input, output, and sanitizing the input you receive.

过期情话 2024-11-10 14:26:08

这始终是一个问题:“我应该制作/构建/创建/开发什么?”

就我个人而言,我总是只是使用 STDIN/STDOUT,了解条件,然后玩/破坏我能想到的任何东西。

That's always the question, "What should I make/build/create/develop?"

Personally, I always just play with STDIN/STDOUT, understand the conditions, and just play/break whatever I can think of.

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