您所在的当前位置: 计算机等级考试题库   >  
BASIC题库  
  >  [填空题] 下面程序运行后,单击命令按钮,输出的结果是 【12】 Private Sub Command1_Click() Dim a%(1 To 4),b%(2 To 6),i%,str1#,str2# For i=1 To 4 a(i)=i Next For i=2 To 6 b(i) =i Next str1 = YAG(a) str2 = YAG(b) Print "str1 ="; str1; "str2 ="; str2 End Sub Function YAG (a ( ) As Integer) Dim t#, i% t=1 For i = LBound(a) To UBound(a) t=t * a(i) Next YAG = t End Function
问题:
发布时间:2022-07-01

[填空题] 下面程序运行后,单击命令按钮,输出的结果是 【12】
Private Sub Command1_Click()
Dim a%(1 To 4),b%(2 To 6),i%,str1#,str2#
For i=1 To 4
a(i)=i
Next
For i=2 To 6
b(i) =i
Next
str1 = YAG(a)
str2 = YAG(b)
Print "str1 ="; str1; "str2 ="; str2
End Sub
Function YAG (a ( ) As Integer)
Dim t#, i%
t=1
For i = LBound(a) To UBound(a)
t=t * a(i)
Next
YAG = t
End Function

可能感兴趣的题目: