历年真题解析一内容摘要:

Integer, M As Integer N=2 DO While m3 N=N+2 If Fun(N) Then Print N M=M+1 End If Loop End Sub Private Function Fun(ByVal N As Integer) As Boolean If N/2=Int(N/2)Then Fun=Fun(N/2) Else If N=1 Then Fun=True End If End Function 4 8 16 江苏省计算机等级考试二级VB 17 1. 执 行下面程序, 单击 Command1按 钮 ,多行文本框 Text1中 显 示的第一行是 ______、第三行是 _____(06年秋填空 1) Option Explicit Private Sub Command1_Click() Dim st As String, n As Integer, ast As String St=”Basic” n=Len(st) Do ast = change (st, n) Text1=Text1 amp。 ast amp。 vbCrlf n=n1 Loop Until n=1 End Sub Private Function change(st As String ,n As Integer) As String Static p As Integer p=p+1 change=Right(st,n1) amp。 Left(st,p) End Function asicB icBas 江苏省计算机等级考试二级VB 18 行下面的程序, 单击 Command1按 钮 ,窗体上 显 示的第一行是 ____、第二行是 ___、第三行是 ___(06年秋填空 3) Option Explicit Private Sub Command1_Click() Dim I As Integer, n As Integer For I = 5 To 15 Step 2 n = fun1(I, I) Print n Next I Print I End Sub Private Function fun1(ByVal a As Integer, b As Integer) b = a + b fun1 = a + b End Function 15 36 26 江苏省计算机等级考试二级VB 19 行下面的程序,在文本框 Text1中 输 入数据 15768后 单击Command1按 钮 ,窗体上 显 示的第一行是 ______、第二行是 ________、第三行是 _______。 (06年秋填空 4) Option Explicit Private Function pf(x As Integer) As Integer If x 100 Then pf = x Mod 10 Else pf = pf(x \ 100) * 10 + x Mod 10 Print pf End If End Function Private Sub Command1_click() Dim x As Integer x = Text1 Print pf(x) End Sub 17 178 178 江苏省计算机等级考试二级VB 20 执 行下面的程序,当 单击 Command1时 ,窗体上 显 示的内容的第二行是 、第三行是 ,第四行是。 (07年春填空 2) Option Explicit Private Sub Command1_Click() Dim a As Integer, b As Integer, z As Integer a = 1: b = 1: z = 1 Call p1(a, b) Print a, b, z Call p1(b, a) Print a, b, z End Sub Sub p1(x As Integer, ByVal y As Integer) Static z As Integer x = x + z y = x z z = x + y Print x, y, z End Sub 1 1 1 3 1 4 1 3 1 江苏省计算机等级考试二级VB 21 执 行下面程序, 单击 Command1按 钮 后, 变 量 fir值 是 ,变 量 sec值是 ,变 量 thir值 是 . (07年春填空 4) Private Sub Command1_Click() Dim fir As Integer, sec As Integer, thir As Integer fir = 96 sec = 421 thir = 3857 Call look_for(fir, sec, thir) Print fir。 sec。 thir End Sub Sub look_for(f As Integer, s As Integer, t As Integer) Dim tem As String If 1 * f * s t Then tem = Left(CStr(f), 1) f = Right(CStr(f), 1) amp。 Left(CStr(s), 1)。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。