题型:单选题 题类:模拟题 难易度:困难
浙江省杭州市2016年信息技术高考模拟卷十四
Function f(n as integer) as long
Dim j As Integer
f=1
For j=1 to n
f=f*j
Next j
End Function
Private Sub Command1_Click()
Dim s As Long, AS Integer
S=0
For i=1 to 6
Next i
Text1.text=str(s)
End Sub
方框中正确的语句是 ( )
⑴分别将十进制数x,y转换为二进制,并将转换的每位二进制数存储到数组a,b中;如果两个二进制位数不相等,则位数较少的前面用“0”补足,使之a,b数组元素个数一致;
⑵取出数组a,b中下标相同的数组元素进行运算,若值相同,则结果为0,否则为1;
根据上述运算方法,示例如表所示。
变量 | 十进制 | 二进制 | ||||
x | 19 | 1 | 0 | 0 | 1 | 1 |
数组a | a(1) | a(2) | a(3) | a(4) | a(5) | |
y | 9 | 0 | 1 | 0 | 0 | 1 |
数组b | b(1) | b(2) | b(3) | b(4) | b(5) | |
x xor y | 1 | 1 | 0 | 1 | 0 |
小明编写了一个VB程序,功能如下:在文本框Text1、Text2中分别输入x、y的值,单击“异或”按钮Command1,程序对数据进行异或运算,并将结果显示在列表框List1中。
试题篮