运行下面的程序后,输出的结果为 Cls Dim t(5, 5) as Integer For i=1 To 5: t(i,i) =1: Next For i = 1 To 5 For j = 1 To 5 Print t(i, j), Next Print Next
A.1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
B.1 1 1 1 1
C.1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1
D.1 1 1 1 1
第1题:
下面运行程序后,单击命令按钮,输出出的结果是【 】。
Private Sub Command1_Click( )
Dim a% (1 To 5) ,i%, s
For i = 1 To 5
a(i) =i
Next
s = Fun(a)
Print"s="; s;
End Sub
Function Fun(a() As Integer)
Dim t, i%
t=1
For i = LBound(A0To UBound(a)
t=t * a(i)
Next
Fun =t
End Function
第2题:
运行下面的程序后,输出的结果为 Cls Dim t(5,5) as Integer For i=1 To 5:t(i,i)=1:Next For i=1 To 5 For j=1 To 5 Print t(i,j), Next j Print Next I
A.1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 l 1 1 1 1 1 1
B.1 1 l 1 1
C.1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1
D.1 1 1 1 1
第3题:
下面程序运行后,单击命令按钮,输出的结果是______。
Private Sub Command1_Click()
Dim a%(1 To 5),i%,s
For i=1 To 5
a(i) =i
Next
s=Fun(A)Print "s=";s;
End Sub
Function Fun(a() As Integer)
Dim t,i%
t=1
For i=LBound(A)To UBound(A)t=t*a(i)
Next
Fun=t
End Function
第4题:
运行下面的程序后,输出的结果为
Cls
Dim t(5, 5) as Integer
For i=1 To 5: t(i, i) =1: Next
For i=1 To 5
For j=1 To 5
Print t(i, j),
Next
Next
A.1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
B.1 1 1 1 1
C.1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1
D.1 1 1 1 1
第5题:
有以下程序
main()
{ int t=1,i=5;
for( ; i>=0; i--) t*=i;
printf("%d\n",t);
}
执行后输出结果是【 】。