OK, says it says enter a float. I give it something that can be converted into a float, it says fine. I'm going to go back and run it again though. If I run it again, it says enter a float.
好了,看到他说输入一个浮点数,我输入它可以转换为浮点数的值,那没问题,我回过来再运行一遍,如果我再运行一遍。
But if, at any point, I get to a place in the list where the thing I'm looking for is smaller than the element in the list, I know everything else in the rest of the list has to be bigger than that, I don't have to bother looking anymore.
比当前位置数组的元素要小,我也就知道后面的数肯定,也都比我的目标数要大了,我就不用再继续进行下去了,这意味着目标数不在这个数组中,我就可以退出了。
And then we'll go ahead and count some measures.
然后我们再开始数一下小节
I cannot reduce the number of dimensions.
我不能再降低维数了
There were previous examples of people trying to have a deep wing that would do things, but if you take me back to my primitive phalanx here about 600-650 they're not doing that stuff yet.
先前有例子,人们会在布阵时增加两翼的排数,如果再回到我这里的原始方阵,公元前六百到六百五十年的方阵,不会采取这种方式
And that's just to take 1 the principle quantum number l and subtract it by 1, and then also subtract from that your l quantum number.
主量子数,减去,再减去,量子数,你们可以对1s轨道来验证一下。
And that then let's me get to, basically, base this code. Having done that, height I simply call base with get float, I call height with get float, and do the rest of the work.
现在让我们看看这段代码,其实已经写好了,我简单的调用下,用来得到一个浮点数,再调用下,来得到另外一个浮点数,然后做剩下的工作就可以了。
And when I do this test, what I want to do, is say I'm going to pick the middle spot, and depending on the test, if I know it's in the upper half, I'm going to set my start at the mid point and the end stays the same, if it's in the front half I'm going to keep the front the same and I'm going to change the endpoint.
如果我知道目标数可能,再比中值点大的区间里,我可能就会把开始点设为中值点,而尾点不变,如果在小的那个区间里,就保持开始点不变而把尾点设为中值点,你们可以看到这儿的代码,就是这么做的,对不对?它是怎么做的?
And then, I wanted to ask something like membership.
然后我想要再看看成员数。
And the next number is the sum of the previous two.
是前两个的和,再下一个数是前两个数的和。
And let's try it with a bigger number.
再换一个大一些的数。
Knowing that, I'm going to say, OK, how many pigs are there, well that's just how we're, however many I had total, minus that amount, and then I can see, how many legs does that give, and then I can check, that the number of legs that I would get for that solution, is it even equal to the number of legs I started with, ah! Interesting. A return.
它将给我返回头的总数,知道了这些之后我可以说好了,有多少猪呢,无论有多少组鸡的数目,我只要用总数减去那个值,之后我就可以知道一共有多少条腿,然后再把这个值和题目中的腿数相比较,看它是否等于一开始的腿数,啊!真有趣,有一个返回值。
If you solve for that, you find y-y0=v0^/, and if you put in the v_0 I gave you, which was what, 10?
如果你解这个式子,你会得到y-y0=v0^/,如果再把我给你的v0代入,那个数是多少 10
I'll get rid of Fibonacci here, we don't want to bother looking at that again.
我在这里会注释掉Fibonacci数,我们不想再看一遍。
If you multiply her, then you want to have as much depth to fill in behind to close that hole as you can, so that that would make your phalanx more sturdy, because you could take more casualties without breaking, that seems reasonable to me.
如果再多一些,你就需要在后面增加足够的排数,尽可能地填补缺口,这会使你的方阵固若金汤,即使伤亡惨重也不影响阵容的坚固,这在我看来是合理的
I've got one test, I've got a subtraction, I've got a multiplication, that's three steps, plus whatever number of steps it takes to solve a problem of size b minus 1.
我进行了一次比较,一次减法,一次乘法,一共是三个步骤,再加上t的步骤数。
应用推荐