But let's just count in terms of the numbers I'm touching 'cause that'll be useful in just a moment.
我明确地数了所动过的,数字,等会儿这个,可能有用。
So what would I want to do? I'd like to somehow walk down each of the digits one at a time and add them up. Ah, that's a looping mechanism, right? I need to have some way of walking through them.
去取这个数的,每个数字然后把他们加起来,啊,这是个循环机制对不对?,我得找到一个遍历它们的方法,一种简单的方法可能。
Seventy-nine. In fact, if you add up each of these numbers, 9 you should get the decimal number 79 79 from this binary number here.
9,事实上,如果你把这些数字累加,你应该能从这些二进制中9,得到十进制数。
How many of you, excluding the people who chose 1 last time, how many of you chose a number that was lower than the number you chose last time?
出了上次选1的人,多少人选了比你,上次选择的数还低的数字
You spin this big wheel and it rotates for a while and then it stops at one number, but obviously a random number, because this wheel of fortune had all the numbers from zero to one hundred.
你转动那个大轮盘,它会旋转一会儿,最后停在一个数字上,显然是一个随机数,因为幸运轮盘可以指向,0到100的的任何数
Now, if we plug in the numbers, we plug in the numbers for HF.
如果加上这个数字,对于HF,我们加上这个数。
Basically if you have a number that's P in this case, than the number is lower then that shows increasing level of statistical significance.
基本上如果P,这幅图里的数比0.05更小,数字越小,表示统计学显著性越大
Well it turns out a bunch of years ago people just decided that if we have the ability to express numbers and we actually care about expressing letters of the alphabet, well we just need some kind of mapping between one and the other, ASCII and so thus was born what's generally called the ASCII.
结果证实,数年前,人们觉得如果我们,有数字表达能力,而我们真正在乎其实是字符的表达,那么我们就需要数字和字符的某种对应关系,于是就有了俗称的。
the winner is the person whose number is closest to 2/3 times the average The winner will win $5 minus the difference in pennies between her choice and that two-thirds of the average."
所选数字最接近2/3倍平均数人是赢家,赢家的奖金是5美元减去,所选数和平均数三分之二之差的百分数
That means starting at the first one, I'm going to do something to it. And what am I'm going to do? I'm going to take that character, convert it back into an integer, and add it into some digits. And I've done a little short hand here, which is I should have said some digits is equal to some digits plus this.
这意味着从第一个字符开始,我要对他们进行一些操作,我要去做什么呢?我要取得这个字符,然后把它转换为整数,然后加到某些数上面去,我在这里用了一些缩写,我本来应该写一个数字等于这个数字。
But that little short hand there is doing exactly the same thing. It is adding that value into some digits and putting it back or signing it back into some digits. And I'll walk through that loop and when I'm done I can print out the total thing does. And if I do that, I get out what I would expect.
加上得到的这个数的,但是这个缩写声明其实是进行了同样的操作,它把我们得到的这个数加到一个数上面去,然后用和对这个数进行了重新赋值,在循环中会去遍历字符串,当完成循环后,程序会显示数字的总和,如果我运行,这个程序的话,我会得到我期待的结果。
Just take a look: if this is 9, 5 divided by 9 is always going to be 0 point something, and if you thus have two integers and you're rounding down, which is what happens when you do integral math we're using this operator, I'm going to get zero times whatever.
稍微看一看:如果这是9,5除以9会得到,0点几,如果你用两个整型数,你舍去小数,这就是当你们,用整型数使用这个操作的所发生的事情,我将得到数值0乘以任何一个数字。
So the strategy choices, we're not going to do it in hours, let's just normalize and regard these choices as living in 0 to 4, and you can choose any number of hours between 0 and 4.
我们用小时数来表示策略吧,用0到4的数字来标记这些策略,你可以从0到4中任选工作的小时数
Percent D is for a digit, like a number or-- one or more digits.
d代表以数字的形式输出,比如一个数字或者--1或更大的数。
But if we know that 65 is the int that maps to the capital letter "A," we've already seen verbally that you can convert letters to numbers and numbers to letters, and so here's the syntax with which we'll soon be doing that.
如果我们知道65是个整型数,对应的是,大写字母“A“,我们已经口头地说明,我们可以把数字转换为字符,字符转化为数字,所以这里就是我们将要学习的一种语法。
For numbers, we had some variations; we had integers, we had floats.
对于数字来说我们学习了很多变量;,包括integer类型,包括浮点数类型。
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“
-- 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子句,只需要说,“你选了一个非法的数字“
应用推荐