C So here I'm declaring a variable called c, and I'm pretty much translating the formula from the slide using the characters on my keyboard to a floating point value.
这里我声明了一个变量,然后我把那个幻灯片上的公式,用键盘上的字符翻译成了,浮点数值。
Now for the hacker edition, if you are feeling up to a bit more of a challenge you'll find that when you run the game, one it's not all that hard to use some ASCII art just make it a little fancier as the teaching fellow who implemented this solution did.
对于升级版,如果你能应付更大的,挑战,你会发现当你在玩这个游戏时,用一些字符画把它做得,比那些教学人员做的更有新意,并不是那么困难。
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.
这意味着从第一个字符开始,我要对他们进行一些操作,我要去做什么呢?我要取得这个字符,然后把它转换为整数,然后加到某些数上面去,我在这里用了一些缩写,我本来应该写一个数字等于这个数字。
Well, get string again is returning the address of the string the user typed in, D the address of the very first character like the letter D and storing that address in this variable s1.
好的,GetString返回的是,用户输入的字符串的地址,第一个字符的地址,比如字母,然后把这个地址存储在这个变量s1中。
s2 So, I'm passing in the first character in s2, I'm making it uppercase and then I'm putting it back so casually speaking this is just capitalizing the first letter of whatever word the user typed in to s2.
那么,我把第一个字符传递给,我把它转换成大写的,然后存下来,简单说,这就是把用户输入s2中的单词,的第一个字母转换成大写的。
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“,我们已经口头地说明,我们可以把数字转换为字符,字符转化为数字,所以这里就是我们将要学习的一种语法。
应用推荐