OK. If last minus first is greater than or equal to 2-- sorry, less than 2, then either look at this thing or look at that thing.
大于等于儿,抱歉,是小于二,看看这里或者那里,这就是我说的要特别小心的地方。
So if n is greater than or equal to 1 and n is less than or equal to 3, let's just judge this thing a small number arbitrarily.
所以n大于等于1,并且n小于等于,我们武断的判定它为,一个小的数字。
We saw that in general dS is greater than T or equal to dq over T.
我们发现一般来说dS大于,或者等于dq除以。
All right, we're-- well actually, I should say that better, we first check to see, is x 0 greater than or equal to zero, if it's not, then we come down here and we print something out, otherwise we run through a little loop to get the answer, and then we check it and we spit something out.
然后我们运行一个小循环,好了,我们现在来看看,如果x≥0或者x<,我们看这儿,我们会输出一些内容,或者我们运行一个小循环来获取答案,然后我们检验一下,然后得到结果。
And keep going, until the square of one of those integers is greater than or equal to - sorry, just greater than x. OK, why am I doing that? When I get greater than x, I've gone past the place where I want to be.
如果还是比x小的话,跳到3,这么继续下去,直到一个整数的平方大于或者等于,对不起,是大于x,好,为什么我要这么做呢?,让我得到的整数的平方和。
If they type in bogus characters, it's going to yell at them and make them retry, and eventually I'm going to get handed back an int, which I'm storing in n. Well, if I actually want to judge this number based on its magnitude, well, I can say now, "If n is greater than or equal to one."
如果他们键入了不合法的字符,它将对他们叫喊,然后叫他们重试,最终我将,得到一个int数,它是存储在n中的,好的,如果我的确想要根据它的量级来判定这个数字,好的,现在我可以指明,“是否n大于等于1“
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的,如果不是的话,请注意会发生什么,下面的代码都不会被执行,程序会到这里来然后显示一些有用的信息,信息会说,嘿,你给了我一个负数,我不知道该怎么弄这个了。
-- Else if n is greater than 4 and n is less than 6 -- 7 let's call it medium -- else if n is greater than or equal to 7, -- less than or equal to 10 -- let's call it "big" -- and if the user typed in zero or negative 10 or 20 or whatever, let's just use the all-inclusive else block and just say, "You picked an invalid number."
否则如果n大于4,并且n小于-,我们叫它为中间数--否则如果n大于等于,小于等于10--我们叫它为“大数“,如果用户键入了0或者-10或20或其它的,让我们用一个广泛的else子句,只需要说,“你选了一个非法的数字“
应用推荐