某电路的计算结果是:I2=2A ,I3= -3A,它表明()。
第1题:
下面程序段的运行结果是【 】。
Option Base 1
Private Sub Swap (a() As Integ
For I=1 to 10\2
t=a(I)
a(I)=a(10-I+1)
a(10-I+1)=t
Next I
End Sub
Private Sub Form_Click()
Dim x(10) As Integer
For I=1 to 10
x(I)=I*2
Next I
Swap x()
For I=1 to 10
Print x(I)
Next I
End Sub
第2题:
下面程序的输出结果是【 】。
Private Sub Form_Click()
i=0
Do Until 0
i=i+1
if i>10 then Exit Do
Loop
Print i
End Sub
第3题:
下面程序段的运行结果是【 】。
Option Base 1
Private Sub swap(a()As InteSer)
For I=1 to 10\2
t=a(i)
a(i)=a(10-1+1)
a(10-1+1)=t
Next1
End Sub
Private Sub Form_Click()
Dim x(10)As Integer
For I=1 to 10
x(i)=I*2
Next1
Swap x()
For1=1 to 10
Print x (i)
Next I
End Sub
第4题:
下面程序的输出结果是( )。 #include"stdio.h" int sub(int m) { static a=4; a+=m; return a; } void main() { int i=2,j=1,k; k=sub(i); k=sub(j); printf("%d",k); }
A.6
B.7
C.8
D.9
第5题:
以下程序的运行结果是( ) #define MAX 10 int a[MAX],i; main() { printf("\n");sub1();sub3(A) ,sub2(),sub3(A) ; } sub2() { int a[MAX],i,max; max=5; for(i=0;i<max;i++)a[i]=i; } sub1() {for(i=0;i<MAX;i++)a[i]=i+i; } sub3(int a[]) { int i; for(i=0;i<MAX,i++)printf("%d",a[i]); printf("\n"); }
A.0 2 4 6 8 10 12 14 16 18 0 1 2 3 4
B.0 1 2 3 4 0 2 4 6 8 10 12 14 16 18
C.0 1 2 3 4 5 6 7 8 9 0 1 2 3 4
D.0 2 4 6 8 10 12 14 16 18 0 2 4 6 8 10 12 14 16 18
第6题:
下面程序的输出结果是【 】。
Private Sub Commandl_Click( )
Dim a(1 To 20)
Dim i
Fori = 1 To 20
a(i) = i
Next i
For Each i In a( )
a(i) = 20
Next i
Print a(2)
End Sub
第7题:
有如下程序: Private Sub Commandl_Click( ) Dim i As Integer For i=1 To 2 DS Next i End Sub Sub DS( ) Dim x As Integer,m As String Static y,n X=X + 1 y=y + 1 m=m &"*”:n=n&"#" Print x,y,m,n End Sub 程序运行后,输出的结果是
A.1 1 * #
B.1 1 * #
C.1 1 * # 1 1 * # 1 2 * #
D.1 1 * # 1 1 * ## 1 2 * ##
第8题:
下列程序的输出结果是______。
Private Sub Command1_Click()
Dim arr(1To 10)
For i=1 To 10
arr(i)=i
Next i
For Each i In arr()
arr(i)=arr(i)*2+1
Next i
MsgBox arr(7)
End Sub
第9题:
下列程序段的运行结果是:Private Sub Command1_Click() Dim n AS Integer I =21: n = 3 do while I>n I=I- n Loop Print IEnd Sub在窗体上打印的结果是______。
A.3
B.5
C.6
D.8
第10题:
设有如下程序: Private Sub search(a()As Variant,ByVal key As Variant,index%) Dim I% For I = Lbound(a)To Ubound(A)If key=a(I)Then index=I Exit Sub End If Next I index=-1 End Sub Private Sub Form_Load() Show Dim b()As Variant Dim n As Integer b=Array(21,64,92,15,72,38,45,72) Call search(b, 45, n) Print n End Sub 程序运行后,输出的结果是
A.2
B.6
C.10
D.12