设有以下函数过程: Function fun(a As Integer,_ b As Integer) Dim c AS Integer If a<b Then c=a:a=b:b=c End If c=0 DO c=c+a Loop Until C Mod b=0 fun=c End Function 若调用函数fun时的实际参数都是自然数,则函数返回的是______。
A. a、b的最大公约数
B. a、b的最小公倍数
C. a除以b的余数
D. a除以b的商的整数部分
查看答案
在窗体上画一个命令按钮(其名称为Command1),然后编写如下代码: Private Sub Command1_Click() Dim a a=Array(1,2,3,4) 1=3:j=1 Do While i>=0 s=s+a(i)*j i=i-1:j=j*10 Loop Print s End Sub 运行上面的程序,单击命令按钮,则输出结果是______。
A. 4321
B. 123
C. 234
D. 1234
在窗体上画一个命令按钮,其名称为Command1,然后编写如下事件过程: Private Sub Command1_Click() Dim a$,b$,c$,k% a="ABCD":b="123456":c="" k=1 Do While k<=Len(a) Or k<=Len(b) If k<=Len(a) Then c=c & Mid(a,k,1) End If If k<=Len(b) Then c=c & Mid(b,k,1) End If k=k+1 Loop Print c End Sub 运行程序,单击命令按钮,输出结果是______。
A. 123456ABCD
B. ABCD123456
C. D6C584A321
D. A182C3D456
请阅读程序: Private Sub Form_Click() m=1 For i=4 To 1 Step-1 Print str(m); m=m+1 For j=1 To i Print "*"; Next j Print Next i End Sub 程序运行后,单击窗体,则输出结果是______。
A. 1**** 2*** 3** 4*
B. 4**** 3*** 2* 1*
C. **** *** **** *
D. * ** *** ****
在窗体上有一个名称为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. 1 4 7 2 5 8 3 6 9
D. 1 2 3 4 5 6 7 8 9