当前位置: 答题翼 > 问答 > 计算机类考试 > 正文
目录: 标题| 题干| 答案| 搜索| 相关
问题

设有如下通用过程:Pubfic Function Fun(xStr As String)As StringDim tStr As String,strL As In


设有如下通用过程:

Pubfic Function Fun(xStr As String)As String

Dim tStr As String,strL As Integer

tstr=“”

strL=Len(xStr)

i=1

Do While i<=strL/2

tStr=tStr&Mid(xStr,i,1)&Mid(xStr,strL-i+1,1)

i=i+1

Loop

Fun=tStr

EndFunction

在窗体上画一个名称为Commandl的命令按钮。然后编写如下的事件过程:

Private Sub Commandl_Click()

Dim S1 As String

S1=“abcdef”

Print UCase(Fun(S1))

End Sub

程序运行后,单击命令按钮,输出结果是

A.ABCDEF

B.abedef

C.AFBECD

D.DEFABC

参考答案
您可能感兴趣的试题
  • 设有如下通用过程:Public Sub Fun(a()As Integer,x As Integer)For i=1 To 5x=x+a(i)NextEnd Sub

  • 设有Function过程:Private Function f(a As Integer, b As Integer) As Integera = a * a:b

  • 在窗体上有一个命令按钮Commandl,通用过程fun和命令按钮的事件过程如下: Private Function fun(B

  • 设有如下通用过程: Public Sub Fun(a() ByVal x As Integer)

  • 设有如下通用过程:Public Function f(x As Integer)Dim y As Integerx=20y=2f=x*yEnd Function在

  • 设有如下通用过程:Public Sub Fun(a( )As Integer x As Integer)For i=1 TO 5 x=x+a(i)NextEnd S