单项选择题
下列程序的执行结果是( )。
Private Sub Form_Activate()
Dim score(3)As Integer,total As Integer
Dim aa score AS Variant
score(1)=50:score(2)=14:score(3)=36
total=0:i=0
For Each aa score In score
i=i+1
tota1=tota1+aa_score
Print i,aa_score,tota1
Next
End Sub
A.1 0 0
2 50 50
3 14 64
4 36 100
B.1 50 50
2 14 64
3 36 100
C.0 50 50
1 14 64
2 36 100
3 36 100
D.0 0 0
1 50 50
2 14 64
3 36 100
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
单项选择题
在窗体上画1个文本框,名称为Text1,然后编写如下程序: Private Sub Form Load() Open C: dat.txt For Output As#1 Text1.Text= End Sub Private Sub Text1_KeyPress(KeyAscii As integer) If______=13 Then If UCase(Text1.Text=______)Then Close 1 End Else Write#1,Text1.Text Text1.Text= End If End If End Sub 程序的功能是,存C盘根目录下建立1个名为dat.txt的文件,在文本框中输入字符,每次按回车键(回车符的ASCII码是13)都把当前文本框中的内容写入文件dat.txt中,并清空文本框中的内容;如果输入“END”,则结束程序,请选择适合空白处的语句( )。
A.KeyAscii "END"
B.Text1.Text "END"
C.Text1.Text 13
D.KeyAscii 13
点击查看答案&解析
单项选择题
窗体上有1个名为List1的列表框,其中已经输入了若干个项目(如图所示);还有2个文本框,名称分别为Text1、Text2,1个名称为Command1的命令按钮,并有以下程序: Private Sub Command1_Click() Dim str As String,s As String,k As Integer s=Text1 str= For k=List1.ListCount-1 To 0 Step-1 If InStr(List1.List(k),s)>0 Then str=str & List1.List(k)& End If Next k If str= Then Text2= 没有匹配项目 Else Text2=str End If End Sub 程序运行时,在Text1中输入“京”,单击命令按钮,则在Text2中显示的内容是( )。
点击查看答案&解析
相关试题
设窗体上有一个名为CD1的通用对话框、一个...
下面的程序执行时,可以从键盘输入一个正整...
有如下程序: Prinvate Sub Form_Click...
过程定义中的变量名叫做______参数,...
有以下程序段,当在消息框中输入8后,y的...