• If I come into this code, I'm going to check this branch first, if it's not true, ah, there's a return at the end of that branch. If it is true, I do that, and then I've got a second test. If it's true, return I return, otherwise a return.

    但是如果我们看看这里,如果我看这段程序,我会先检查这一部分,如果它是假的,啊,这部分分支结尾有一个。

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • Notice in this program I have not checked whether or not the user actually provided input.

    就拿这个程序说事吧,我们根本没有检查,用户到底有没有输入。

    哈佛公开课 - 计算机科学课程节选

  • And those are two things that you'd like to do with every looping construct you write: you'd like to be able to assure yourself that they will always terminate, and then the second thing you'd like to do, is to assure yourself that it does give you back a reasonable answer.

    就是现在我有了能去检查程序,是不是做了正确的操作的能力:,这就是你们在写每个循环程序的时候,都要注意的两个事情:,第一件事情是要确保程序可以终结,第二件你要做的事情,就是要确保程序返回了正确的答案。

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • These days those things constantly spell check your program for you.

    现在这些软件将会为你,做程序的拼写检查

    哈佛公开课 - 计算机科学课程节选

  • So the way to think about this in terms of flow is, it starts with that if and it says, check both of those things.

    因此用控制流的方式,来考虑这件事就是,程序由if开始,然后要对两件事情,都进行检查

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • I probably whip out a do while loop very rarely, but very often when programming games or any program that takes user input and has to check that user input and yell at the user if they're messing with you or aren't providing what's expected.

    我可能很少用do,while,循环,但常常是,当编制程序游戏或需要用户输入的程序是,需要检查用户的输入并提醒用户,如果他们干扰了你,或没有提供所期望的输入。

    哈佛公开课 - 计算机科学课程节选

  • But notice what this does. The first thing it does is, it says, let's check and make sure x is greater than or equal to 0. If it isn't, notice what's going to happen. None of that block is going to get executed, and it's going to come down here and print out a useful piece of information, which says, hey, you gave me a negative number. I don't know how to do this.

    做的是和以前一样的事情,但是注释它做了什么,第一件做的事情就是,程序说,要去检查并且确信x是大于等于0的,如果不是的话,请注意会发生什么,下面的代码都不会被执行,程序会到这里来然后显示一些有用的信息,信息会说,嘿,你给了我一个负数,我不知道该怎么弄这个了。

    麻省理工公开课 - 计算机科学及编程导论课程节选

$firstVoiceSent
- 来自原声例句
小调查
请问您想要如何调整此模块?

感谢您的反馈,我们会尽快进行适当修改!
进来说说原因吧 确定
小调查
请问您想要如何调整此模块?

感谢您的反馈,我们会尽快进行适当修改!
进来说说原因吧 确定