在窗体上画一个名称为Command1的命令按钮,然后编写如下程序: Option Base 1 Private Sub Command1_Click() Dim c As Integer, d As Integer d = 0 c = 6 x = Array(2, 4, 6, 8, 10, 12) For i = 1 To 6 If x(i) > c Then d = d + x(i) c = x(i) Else d = d - c End If Next i Print d End Sub 程序运行后,如果单击命令按钮,则在窗体上输入的内容为( ).
查看答案
在窗体上画一个名称为Command1的命令按钮,然后编写如下程序: Private Sub Command1_Click() Dim i As Integer, j As Integer Dim a(10, 10) As Integer For i = 1 To 3 For j = 1 To 3 a(i, j) = (i - 1) * 3 + j Print a(i, j); Next j Print Next i End Sub 程序运行后,单击命令按钮,窗体上显示的是( )
A. 1 2 3 2 4 6 3 6 9
B. 2 3 4 3 4 5 4 5 6
C. 3 4 7 2 5 8 3 6 9
D. 1 2 3 4 5 6 7 8 9
若在C程序中有以下说明和语句,则下面表示的都是对数组元素的正确引用的是(其中0<=i<4, 0<=j<3)int main( ){int a[4][3]={0},(*ptr)[3],i,j;ptr=a;}
A. a[i][j], a[i]+j, *(*(a+i)+j)
B. *(ptr+i)[j], ptr[i]+j, *(*(ptr+i)+j)
C. *(ptr+i)[j], *(a+i)[j], *(ptr+i)
D. ptr[i][j], *(ptr[i]+j),*(a[i]+j)
若有以下定义,则数组为4的表达式是_____。int a[3][4]={{0,1},{2,4},{5,8}},(*p)[4]=a;
A. *a[1]+1
B. p++,*(p+1)
C. a[2][2]
D. p[1][1]
下列程序的输出结果是_____。#include#includeint main(){ char *p2,s1[10]="bcd",str[50]="xyz";p2="ABCD";strcpy(str+2,strcat(s1+2,p2+1));printf("%s",str);return 0;}
A. xydBCD
B. abcABZ
C. Ababxy
D. xybcBCD