• And if that's true is everything in the string, starting at the first element and removing the last element, a palindrome?

    如果是相同的话,是不是字符串中的所有从第一个元素开始,并且删除最后一个元素后?

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • And then hash character takes in any string or character, single character, gives me back a number. Notice what I do.

    然后哈希接受任何字符串或字母,单个字符,返回给我一个数字,注意我要做什么。

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • printf And then I'm gonna use the same printf line after that to actually plop it into this formatted string.

    我还是要用到,来把它转换成格式化字符串

    哈佛公开课 - 计算机科学课程节选

  • And here, I'm going to suggest we've seen numbers, we've seen strings, and I'm going to add Booleans here as well.

    我要提醒下大家我们学习过数字数据了,学习过字符串了,今天还要学习布尔类型,这是当我们谈到条件的时候。

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • Notice what it says. I'm going to pass in 1 a string, call it s, binds it locally, and it says the following.

    然后看接下来的内容,接下来说的是如果这个字符串的长度等于,那么我就成功了。

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • Now I could have made a key, keys don't have to be strings, but as it happened, I didn't.

    现在我可以建立一个键了,键并不一定是字符串,但这儿既然已经是字符串了。

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • It happens to be better suited for manipulating strings than numbers, for example, but it's really a general-purpose language.

    例如它恰好,处理字符串,比处理数字更有效率,但是它确实是一种面向面很广的语言。

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • Is it is just like a string of words or-- >> What does-- what does what mean? A string?

    字符串?单词?还是?,>>你刚刚说什么?,一个字符串

    哈佛公开课 - 计算机科学课程节选

  • It turns out when we call string a string, we're really referring not to those characters but to the address, the location and memory of those characters.

    当我说字符串时,我并不是指这些字符集,而是指地址,就是这些字符集在存储器中的位置。

    哈佛公开课 - 计算机科学课程节选

  • That is if I can write code that would solve all instances of smaller size strings, then what I just described isPalindrome will solve the larger size one.

    然后我会描述如何处理大字符串,事实上这正是我所做的,我希望你能看看这边的这段代码,就是这个。

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • So now that we begin to have this ability to express strings in memory, to understand what they are, we can start to apply actually real-world algorithms to them.

    现在我们开始用这个技能来在内存中表达字符串,来理解它们是什么,我们可以开始,我们可以对其使用实际的,现实生活中的算法。

    哈佛公开课 - 计算机科学课程节选

  • But really, the computer's just so fast I'm drawing the same string with just a slightly different number again and again after going to sleep one second at a time.

    但是真实地,这个计算机到现在为止,我一次又一次用稍微不同的数字,绘画了相同的字符串,在睡眠1秒钟之后。

    哈佛公开课 - 计算机科学课程节选

  • And the nice thing is that there's a shared behavior there. Just as I can have tuples as an ordered collection of things, strings behave as an ordered collection of things.

    共享的行为,就像元组是有序的元素序列,字符串也是有序的元素序列,因此我可以对字符串做同样的操作,我可以把它们连结起来。

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • Now, if I've asked the user for a string and then a moment later I ask the user for another string, well, they're going to end up in different locations in memory just by nature of get string.

    现在,如果我要用户输入一个字符串,一会儿之后我要用户输入另一个字符串,他们最终是在,不同的内存地址中。

    哈佛公开课 - 计算机科学课程节选

  • Characters are simple. Suppose you want to represent sets of strings, well you basically just generalize the hash function.

    字母是是很简单的,如果你想表示一组字符串,基本上你要做的就是归纳出哈希函数。

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • Otherwise I'm going to check to see is the first and last, there's that - 1 indexing, is the first and last element of the string the same?

    是第一个还是最后一个,这就是这边-1的索引内容,这个字符串的第一个,和最后一个的内容是否相同呢?

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • So if I want to use a string as we'll call it which is a word or phrase generally, they always go between double quotes, David hence the quotes around David, and they are double quotes not single quotes intentionally.

    当我们要表示单词啊,词组啊,句子啊等等这样的东西时,就会用到字符串,它们位于双引号之间,也就是这里双引号之间的,是双引号,不是单引号哦。

    哈佛公开课 - 计算机科学课程节选

  • If somewhere later on in the code it shifts to string, I might not be manipulating that and getting actual values out, but not what I wanted, and it's going to be really hard for me to chase it back.

    然后后面的一些代码,把变量类型变为了字符串,我可能不会通过实际操作,去取得实际的变量的类型,但是这并不是我想要的类型,而且对我来说把类型,变回去也很困难。

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • Just the first one or more generally the address of the first one and then, man, I'll just figure it out from there where the rest of the letters are because by definition of a string, they're back to back to back.

    只需要第一个字节的地址,然后,我可以指出之后的,剩下的字母,因为通过一个字符串的定义,它们是紧邻的。

    哈佛公开课 - 计算机科学课程节选

  • We've looked so far really at two non-scalar types. And those were tuples written with parentheses, and strings.

    关于这两种基本类型我们已经,学的相当多了,包括哪些元组和字符串类型。

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • And we're going to start with one that you many of you, have already bumped into perhaps by accident, which are lists.

    曾经遇到过的,可能是偶然遇到的类型来开始,就是数组,数组和字符串类型。

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • STUDENT: Good question. Sounds like a reasonable guess How in the world am I going to compare a string to a number?

    学生:不可闻的声音:,很好的问题,听起来像一个很合理的猜测,我到底该怎么对一个字符串,和一个数字进行比较呢?

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • There's a function in purple, there's a string in green, and in black I have the assignment statements.

    还有个粉色的方法,绿色的字符串,赋值声明是黑色的。

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • And when we return the string to you we're essentially telling you where this chunk of memory is.

    当我们返回该字符串时,我们实际上是告诉你,这块存储单元位于哪里。

    哈佛公开课 - 计算机科学课程节选

  • If you know you're not gonna output a full string %C but a single character, percent C will get that job done.

    如果你不想输出一个完整的字符串,而是输出一个字母,就要用到。

    哈佛公开课 - 计算机科学课程节选

  • It could also say, what are the methods associated with the string, 1. I'm sure you can quickly graph it, but notice they aren't the same.

    我们也可以说,与字符串1相关联的方法有哪些?,我相信你们可以很快的求出来,但是请注意这跟前面的。

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • That is the address in memory in the heap of the first byte that the user typed in.

    那是用户输入的字符串第一个字节,内存中堆的地址。

    哈佛公开课 - 计算机科学课程节选

  • You can't just take a quoted string back to back with another quoted string so you'd get some kind of compiler error.

    你不能让一个引起来的字符串跟另一个引起来的字符串,背靠背,这样编译就会出错。

    哈佛公开课 - 计算机科学课程节选

  • other people had solved that problem for me, and this thing between quotes, we'll start calling a string.

    至于如何实现的别人已经解决了,这个在引号之间的东西叫字符串

    哈佛公开课 - 计算机科学课程节选

  • You don't see strings with commas between them, but it has the same kind of property. It is in ordered sequence of characters.

    它是有序的字符序列,我们可以对字符串做同样的操作,我们也可以得到字符串中的一块。

    麻省理工公开课 - 计算机科学及编程导论课程节选

$firstVoiceSent
- 来自原声例句
小调查
请问您想要如何调整此模块?

感谢您的反馈,我们会尽快进行适当修改!
进来说说原因吧 确定
小调查
请问您想要如何调整此模块?

感谢您的反馈,我们会尽快进行适当修改!
进来说说原因吧 确定