In a blog post called "First Click Free," Google's senior business product manager Josh Cohen wrote: "Previously,each click from a user would be treated as free.
VOA: standard.2009.12.05
But odds are it's not sufficient just to get it from the user, I, the human need to be handed whatever this function got from the user in some form.
如果只是从用户,我这里获取,好像有点不太准确,我们得交出,该函数从用户那里得到的一切信息。
Otherwise, what was the point of getting a string from the user if I'm not handed the result to actually do something interesting with.
否则的话,它不把值带给我们,我们就做不了想做的事情,那我们还要它有什么用呢?
We've been using strings thus far to get input from user and store it in variables.
迄今为止,我们用字符串来接受用户的输入,然后存储在变量里。
GetDouble If you just want a single letter from the user, GetDouble.
如果你想得到一个单独的字母,用。
If you want to get some input from the user, my God I don't want to have to program it to low level zero and 1 just to get keys from the keyboard; please let there have been someone who does that for me and indeed there are an increasingly sophisticated options that you can pull off the shelf.
如果你想获得一些用户的输入数据,我的上帝,我可不希望在键盘上敲入0,1的低水平方式来编程;,希望有个人能帮我做这件事吧,但是现有的选择,也变得日益复杂了。
Even those of you who've taken AP computer science or something similar perhaps recall that even just getting a piece of input from the user is ridiculously not obvious.
你们中上了AP计算机科学这门课,或者类似的课程的人可能还记得,即使只是从用户那里得到一个输入,也相当麻烦。
So when you have a function called GetString, -- that means it's going to get a string from the user -- -- prompt the user for a string -- whereas printf is literally going to print it, not to paper, but to the screen.
所以当你有一个叫做GetSting的函数,它的意思是从用户那获得一个字符串-,提示用户输入一个字符串-,然而printf的确是用来打印的,不是在纸上,而是在屏幕上。
If you called get string multiple times, surely you've been able to get different strings from the user.
如果你调用GetString好几次,你可以从用户那里获得不同的字符串。
Right now, we're finally getting to the point of scratch which can take some input from the user.
马上,我们能接近scratch的关键了,即从用户那里获取输入。
A few of you were probably wondering, "Well, how do I actually get the int from the user?"
有的同学可能想知道:,“我们怎么通过用户获得那个int数值“
Odds are when this function called gets a string from the user by expecting them to manipulate their keyboard - with their fingers, I need to-- initiatively I'm gonna get back a sentence or a word or a phrase or something.
调用GetString获取的信息也有可能,是通过键盘敲进来的,东西-,它将会返回句子啊,单词啊,或词组啊等等一些信息。
So long as I say I'm gonna put a string here, it doesn't matter what string it is, GetString is gonna take care of the job of getting it from the user.
把变量放在这,我们先不要管这个string是什么,GetString会负责,从用户那里获取该值。
Go ahead and implement with the person next to you a program that takes as input from the user an integer called F and prints out the answer of the Celsius equivalent.
继续和你旁边的人执行程序,取来自用户的整数F作为输入,然后打印出与之等价的摄氏温度的答案。
But GetString as its name implies is supposed to get something from the user.
照这么说来,GetString按字面意思解释,就是--从用户那里获取一些东西。
So we'll talk a bit more about this idea of functions today, but, get int, again, can think of it as a black box, whose purpose in life is to prompt the human for input and pester the human if he or she doesn't actually give it int, but then once it has that, has entered it from the user, it's quote unquote, returns it to you.
所以我们进今天将多讨论点这个函数的概念,但是,GetInt,我们可以把它当做一个黑盒子,它的唯一目的是提示人们来输入,并且如果他或她没有,给它int数,则会纠缠用户,但是一旦它得到了,用户输入的int数,对输入进行引用,返回给你。
I'm going to use the CS50 Library instead for user input I'm saying say something then I'd get a string from the user and I call time s1 and then I say, say something, s2 and then I get another string from the user and call it s2 and apparently this program's purpose in life is to tell me yes or no the user said the same thing both times.
然而我使用的是CS50库来获得用户输入,我说点什么,然后从用户那里获得一个字符串,并把它叫做s1,然后我说点什么,然后从用户那里获得一个字符串,并把它叫做2,这个程序的最终目的是,告诉我两次用户输入的是不是同样的东西。
应用推荐