下列程序的执行结果为( )。 Ptivate Sub Command_Click( ) DimFirStr As String FirStr="abcdef" PrintPat(FirSb) End Sub PrivateFunctionPat(xStr As String)As String DimtempStr As String,strLen As Integer tempStr="" strLen=Len(xStr) i=1 DoWhile i<=Len(xStr)-3 tempStr=tempSlx+Mid(xStr,i,1)+Mid(xStr,strLen-i+1,1) i=i+1 Loop Pat=tempStr End Function
A:abcdef B:afbecd C:fedcba D:defabc
现有一个文件file21.txt,其内容是: abCdEf, 执行下列程序之后,输出的结果是______。 package ch1; import java,io.*; public class ex21 { static String name = "ch1//file21.txt"; public static void main(String[] args) { try { readFile ( ); } catch(IOException ioe) { System.out.println(ioe.getMessage( )); } } static void readFile ( ) throws IOException { BufferedReader br = null; try { File f = new File(name); FileReader fr = new FileReader(f); br = new BufferedReader(fr); String str= br.readLine( ); System.out.println(str.toLowerCase( )); } finally if(br != null) br.close ( ); } } }
A:AbCdEf B:abcdef C:aBcDeF D:ABCDEF
单击窗体时,下列程序的执行结果是( )。
Private Sub Invert(By Val xstr As String,ystr As String)
Dim tempstr AS String
Dim I AS Integer
I=Len(xstr)
Do While I>=1
tempstr=tempstr + Mid(xstr,I,1)
I=I - 1
Loop
yStr=tempStr
End Sub
Private Sub Form_Click( )
Dim s1 As String,s2 As String
S1="abcdef"
Invert S1,S2
Print S2
End Sub
A:abcdef B:afbecd C:fedcba D:defabc
下列程序的执行结果为( )。
Private Sub Command1_Click( )
Dim s1 As String,s2 As String
S1;="abcdef"
Call Invert(s1,s2)
Print s2
End Sub
Private Sub Invert (ByVal xstr As String,ystr As String)
Dim tempstr As String
i=Len(xstr)
Do While i>=1
tempstr=tempstr+Mid(xstr,i,1)
i=i-1
Loop
ystr=tempstr
End Sub
A:fedcba B:abcdef C:afbecd D:defabc
下列程序的执行结果为( )。 Private Sub Command1_Click( ) Dim s1 As String,s2 As String s1="abcdef" Call Invert(s1,s2) Print s2 End Sub Private Sub Invert(ByVal xstr As String,ystr As String) Dim tempstr As String i=Len(xstr) Do While i>=1 tempstr=tempstr+Mid(xstr,i,1) i=i-1 Loop ystr=tempstr End Sub
A:fedcba B:abcdef C:afbecd D:defabc
单击窗体时,下列程序的执行结果是 Private Sub Invert(By Val xstr As String,ystr As String) Dim tempstr AS String Dim I AS Integer I=Len(xstr) Do While I>=1 tempstr=tempstr + Mid(xstr,I,1) I=I - 1 Loop ystr=tempStr End Sub Private Sub Form_Click( ) Dim s1 As String,s2 As String S1="abcdef" Invert S1,S2 Print S2 End Sub
A:abcdef B:afbecd C:fedcba D:defabc
设有如下通用过程:
Public 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
End Function
在窗体上画一个名称为Command1的命令按钮。然后编写如下的事件过程:
Private Sub Command1_Click( )
Dim S1 As String
S1="abcdef"
Print UCase(Fun(S1))
End Sub
程序运行后,单击命令按钮,输出结果是
A:ABCDEF B:abcdef C:AFBECD D:DEFABC
设有如下通用过程: Public 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 End Function 在窗体上画—个名称为Command1的命令按钮。然后编写如下的事件过程: Private Sub Command1_Click( ) Dim S1 As String S1="abcdef" Print UCase(Fun(S1)) End sub 程序运行后,单击命令按钮,输出结果是______。
A:ABCDEF B:abcdef C:AFBECD D:DEFABC