• Then the next thing in the loop, we're going to enter a nested loop and say for every college in the list e, we're going to print the name of the college.

    循环中的第二件事,是进入一个嵌套循环,这个嵌套循环将数组中的,大学名字显示出来。

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

  • I've written a little for loop, which is going to iterate over all of the elements in the list.

    让我们先看看这儿的代码,我已经写了一个循环语句,用来迭代处理数组中所有的元素。

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

  • Condition," this thing in the middle between the semicolons, is going to be checked every iteration of the loop.

    条件,“这个在两个分号的中间,它将迭代地检查这个循环的条件。

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

  • And there is a self-enforcing loop between the two, where helping others helps ourselves; and helping ourselves, in turn, helps others.

    两者间有自我实施的循环,帮助他人就是帮助自己;,帮助自己继而帮助他人。

    哈佛公开课 - 幸福课课程节选

  • We're gonna have a so called a loop, an infinite loop and you actually experience this in the real world.

    我们将会做一个循环,一个无限循环,你会在这个,真实世界里体验它。

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

  • So this is a nice little search-- sorry, a nice little sort algorithm . And in fact, it's relying on something that we're going to come back to, called the loop invariant.

    恩,这是一个很棒的小搜索,抱歉,和很棒的小排序算法,事实上,它依赖于一些我们要回顾的东西,被称作循环不变量。

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

  • printf So here I'm culling printf in a loop again and again, but I'm literally overwriting the previous thing that I wrote.

    所以这里我一次次地在循环中使用,但是我逐行地覆盖了我之前所写的东西。

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

  • And we won't wait here one hundred seconds for it to finish, but we're using the loop, we're updating a variable, and we're formatting it in a nice way.

    我们将不会再这里等待100秒来等它完成,但是我们使用循环,我们更新一个变量,我们把它排成一个漂亮的格式。

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

  • So in a sense, that's a good infinite loop that is as long as you're using the program, it's constantly checking your grammar and spelling, and underlining things, so infinite loops aren't necessarily bad if the objective is actually being met.

    因此从这个意义上说,这是个好的无穷循环,只要你开始使用这个软件,它不停的检查你的语法,拼写或者下划线等,通过这种方式达到目标的时候,这样的无穷循环并不总是坏的。

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

  • At the end of the first round, I've got the smallest element at the front. At the end of the second round, I've got the smallest two elements at the front, in fact I got all of them sorted out. And it actually runs through the loop multiple times, making sure that it's in the right form.

    看看发生了什么,在第一轮结束后,我把最小的元素移到了前面,第二轮结束后,我把最小的,两个元素移到了前面,实际上,所有的元素都排好序了,实际上,这个算法运行了几次循环,确认下这是正确的形式。

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

  • What's the first thing I do in a loop?

    我在循环中做的第一件事情是什么呢?

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

  • One of the things we said last time was, with that set of things, the ability to give values-- sorry, to give names to values-- the ability to make decisions, the ability to loop as a function of that, the ability get things in and out, we said that that actually gave us a language we said was Turing-complete.

    上次我们和以上内容一起说过,我们可以赋值--抱歉,为数值命名--可以做出判断决定-,并且据此进行循环,可以输入输出数据,我们说拥有这些功能的语言,是图灵完备的。

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

  • Yes. The point is, it's not going to work, and she caught both of them, impressive, it's not going to work because iters left is already negative, it's just going to skip the whole loop, and I'm in trouble, so thank you for catching that.

    是的,重点是,程序不会运行的,她发现了两个错误,很令人敬佩,程序不会运行,因为iters,left已经是负数了,它会跳过整个循环,然后就有麻烦了,谢谢你提出这个问题。

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

  • And so the guys in Office Space took that money and they-- -- their for loop-- way too fast is-- was the takeaway in that movie, when they freaked out because they had million dollars or something like that overnight.

    所以在办公地点里的家伙才能够搞到钱-,然后利滚利--很快的方法-,这就是整个影片的亮点,当他们出于极度兴奋之中,因为他们已经一夜之间,变成百万富翁了。

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

  • Well in C and other languages that we'll see this semester, you use what's called the for loop, and this as syntax isn't quite as straightforward but once you know what to look for, it's very easy to understand.

    在C语言和一些我们这学期将要接触的编程语言中,你将会用到所谓的for循环,也许作为一种语法规则,它看起来不是那么的通俗易懂,但是你一旦知道曲中奥妙,就不难理解了。

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

  • is run a FOR loop here. I'm going to let the number of chickens be in this range.

    我知道怎么做对吧?写一个小循环,我所需要做的就是运行一个for循环。

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

  • Because the for loop hands me placeholders in between those semicolons for variables and such, now I don't have those with while loops.

    因为for循环给我提供了为变量准备的占位符,它们在分号之间,现在在while循环中,我没有这些。

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

  • I'm going to give a name to that. And what you see there is I'm going to call divisors initially an empty tuple, something has nothing in it. Right here. And then I'm going to run through the same loop as before, going through this set of things, doing the check.

    你们可以看到这里,我初始化一个空的元组,名为divisiors,这里,然后我会去运行,跟以前一样的循环,遍历这个集合内的东西,然后做检查,现在我要做的是,每次我找到了一个除数我要把它收集起来。

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

  • And then I run a loop in which I read something in, I check to see if it's the right type, if it is, I change that variable to say it's now the correct type, which means the next time through the loop, I'm going to say I'm all set and I'm going to bounce out.

    因为我还没输入,然后我运行一个循环,循环内部我输入一些东西,然后看看是不是正确的类型,如果是的话我改变input,Ok为真,来证明输入数是正确的类型,这就意味着下一次运行这个循环的时候,就可以跳出循环继续执行了。

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

  • So in other words, if you terminate these lines early, if you terminate the four loop early, if you terminate an if condition early with that semicolon, the code may very well work; and this is a common source -- of frustration and conundrum because you don't -- because your code looks right and yet it's misbehaving, but that semicolon means stop looking for subsequent lines of related code.

    换句话说,如果你用分号过早的终止了这些代码行,如果你过早地终止了那个for循环,如果如此,一个if条件,代码可能可以运行,这就是,挫折和问题产生的源头,因为你没有-,因为你的代码看起来是正确的,但是运行是错误的,那个分号的意思是,停止寻找后面相关的代码。

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

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

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

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