WHO says if her attempts to terminate pregnancy fail, she turns to someone without adequate medical qualifications.
VOA: standard.2010.06.24
What I mean by that is, pick a simple set of values, and let's walk through it to see what happens. And this is useful because it's going to allow me to A make sure that I've got something that's going to terminate, it's going to let me make sure that in fact I'm doing the right kinds of updates.
原因你们知道的,好,模拟代码,我的意思就是,选出一系列的值来,然后模拟下代码的执行来看看结果,这很有用因为这让我确保我的程序在某个地方,可以终止,还会让我确保实际上我。
In American law, you cannot terminate an employee, for the sole purpose of age.
美国法律规定,如果你仅因为年龄原因辞退员工,
bugs That is a problem that may not terminate.
随机的在代码中去搜寻。
The semicolons to terminate lines.
分号标志一行的结尾。
And that's very nice, because this allows me to be sure that my FOR loop is going to terminate.
因为这让我确信我的FOR循环是会终止的,因为只要集合是有限的。
Does this terminate? Somebody.
这会不会终结?有人知道么。
All right, first question. What values of x does it terminate? Again, assume x is an integer.
好,第一个问题,对于x的什么值程序,会最终终止,还是假设x为整数。
Well, break it down into pieces. Suppose x is positive. Does it terminate? Sure. All right?
好,分开来讨论,假设x是整数,程序会终结么?肯定会的对不对?
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.
就是现在我有了能去检查程序,是不是做了正确的操作的能力:,这就是你们在写每个循环程序的时候,都要注意的两个事情:,第一件事情是要确保程序可以终结,第二件你要做的事情,就是要确保程序返回了正确的答案。
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条件,代码可能可以运行,这就是,挫折和问题产生的源头,因为你没有-,因为你的代码看起来是正确的,但是运行是错误的,那个分号的意思是,停止寻找后面相关的代码。
And in fact, now let me ask those two questions about this piece of code. First question is, for what values of integers-- we're going to assume integers-- but for what values of x does this code terminate? And the second question is, for what values of x does it give me back the right answer?
实际上,让我关于这块代码问两个问题,第一个问题是,对于什么样的整数值,我们会假设是整数,对于x的什么值程序,会最终终止?第二个问题是,对于x的什么值程序,会返回正确答案?
应用推荐