How do I ensure the user is only allowed integer input?
我如何确保只允许用户输入整数?
PrefixInt prefixes a (user-configured) integer to its integer input stream.
PrefixInt 在它的整数输入流之前加上一个(用户配置的)整数。
If that integer divides the input integer, it adds not only that integer but the input integer divided by the counter-integer, and adds them to a list.
如果该整数可以除输入整数,则不仅要加上该整数而且要加上除以计数整数的输入整数,并将它们添加到一个列表中。
And then, if I want to find out if something's there, I do the same thing. But notice now, hash is converting the input into an integer.
然后,我想查找出某些元素是否在列表中,我做同样的事,但是现在注意,哈希是将输入转化成一个整数,所以,其思想是什么?
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作为输入,然后打印出与之等价的摄氏温度的答案。
b OK. In this example I'd use b. All right, as b get-- b is the thing that's changing as I go along here, but it could be things like, how many elements are there in a list if the input is a list, could be how many digits are there in a string if the input's a string, it could be the size of the integer as we go along. All right.?
好,在这个例子里我会用,因为b是一直在变的东西,但是也可能是如下情况:,如果输入是数组的话,变化的就是数组的元素数,如果输入是字符串的话,变化的就是字符串的长度,如果是integer的话,可能就是这个数的大小,对不对?
应用推荐