• All right? The first one is, that test has to involve-- shouldn't have to, the value of some variable.

    好不好?第一件事是,循环开始的测试必须必须-不是一定,一些变量的值。

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

  • And when I'm done with the whole thing, before I end the increment of the variable, you know, when I'm done, I'm just not returning anything out.

    循环外面初始化它,然后做一个终结测试,然后在循环内部有一个指令集,在这个例子中,就是对余数做检查,然后显示信息,当我完成了整个循环

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

  • Otherwise the test is always going to be true, we're going to go off here, but this would loop forever if I did that.

    否则测试结果就会一直为真,我们需要离开这个测试,否则就会一直执行循环

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

  • All right. Second question: or maybe a better way of saying this, and the general format you're likely to see here is, a test involving a variable name, which must be initialized outside of the loop, and which interior to the loop gets changed, so that the test is going to change.

    好,第二个问题:,换种更好的方式来说吧,你们通常喜欢的,方式是,这个测试涉及到一个变量名字,变量在循环外已经被初始化,然后循环内部会改变这个变量的值,因此测试结果会改变。

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

  • Remember last time, we wrote this simple piece of code to print out even or odd. If, you know, x, 1 it was in fact, even or odd. So let me show you what a flow chart for that would look like, because I want to make a comparison point here.

    这就像这里有一些脚蹼一样,首先进行测试,然后把球这样放来让ANS加,然后回来继续测试,最终跳出循环然后打印答案。

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

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

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

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