更多"下列程序实现的功能是:当在窗体上单击时,将输出a1.txt 文件中的数"的相关试题:
[填空题]下列程序实现的功能是:当在窗体上单击时,将输出a1.txt 文件中的数字字符的个数。
Private Sub form_ Click( )
Dim Ch As String * 1
Dim n As Integer
Open "c://a1. txt" for Input As #10
do while
Ch = Input(1, #10)
if then
n=n+1
End if
Loop
Close #10
End Sub
[填空题]下列程序实现的功能是:当在窗体上单击时,将在窗体上输出c:/a1.txt文件中的所有小写字母。
Private Sub Form_Click( )
Dim Ch As String*1
Open"c:/a1.txt"For Input As #10
Do While 【13】
Ch=Input(1,#10)
If 【14】 Then
Print Ch;
End If
Loop
【15】
End Sub
[填空题]下列程序实现的功能是:当在窗体上单击时,将在窗体上输出c:/a1.txt文件中的所有小写字母。
Private Sub Form_Click( )
Dim Ch As String*1
Open"c:/a1.txt"For Input As #10
Do While 【13】
Ch=Input(1,#10)
If 【14】 Then
Print Ch;
End If
Loop
【15】
End Sub
[填空题]下列程序实现的功能是:当在窗体上单击时,将随机产生100个3位数,并把它们写到D盘根目录下的文件myfile1.Dat中。
Private Sub Form_Click( )
Dim k As Integer
Open 【13】
Randomize
For i=1 To 10
k=100+Int(899*Rnd)
【14】
Next i
【15】
End Sub
[填空题]下列程序实现的功能是:当在窗体上单击时,从键盘上读入5个学生的学号、姓名、英语成绩并存入到文件d:/stu1.dat中,然后从文件中读出第3个人的学号、姓名和英语成绩并显示在窗体中。
Type student
No As Long
Name As String * 20
English As Integer
End Type
Private Sub form_ Click ( )
Dim k As student, i As Integer
【8】
Open "d:/stu1. dat" for Random As #10 Len = Reclen
for i = 1 To 5
k. No= InputBox(“请输入学号”)
k. Name = InputBox (“请输入姓名”)
k. English= InputBox (“请输入英语成绩”)
【9】
Next i
【10】
Print k. No; k. Name; k. English
Close #10
End Sub
[填空题]下列程序实现的功能是:当在窗体上单击时,把C盘根目录下的文件a1.txt复制到 D盘,并取名为a2,txt。
Private Sub Form_Click( )
Dim Ch As String
Open "c:/a1.txt" For 【13】 As #10
Open "d:/a2.txt" For Output As #r20
Do While 【14】
Line Input #10,Ch
【15】
Loop
Close 10
Close 20
End Sub
[填空题]下列程序实现的功能是:在窗体上单击时,将在窗体上输出c:=a1.txt文件中的所有小写字母。
Private Sub Form Click( )
Dim Ch As String * 1
Open "c:/a1.txt" For Input As #10
Do While 【8】
Ch= Input(1, #10)
If 【9】 Then
Print Ch;
End If
Loop
【10】
End Sub
[填空题]下列程序实现的功能是:在窗体上单击时,将在窗体上输出c:=a1.txt文件中的所有小写字母。
Private Sub Form Click( )
Dim Ch As String * 1
Open "c:/a1.txt" For Input As #10
Do While 【8】
Ch= Input(1, #10)
If 【9】 Then
Print Ch;
End If
Loop
【10】
End Sub
[填空题]在窗体上画两个文本框,其名称分别为Text1和Text2,然后编写如下事件过程:
Private Sub Form_Load( )
Show
Text1.Text=""
Text2.Text=""
Text2.SetFocus
End Sub
Private Sub Text2_KeyDown(KeyCode As Integer, Shift As Integer)
Text1.Text=Text1.Text+Chr(KeyCode-4)
End Sub
程序运行后,如果在Text2文本框中输入“efghi”,则Text1文本框中的内容为 【11】 。
[填空题]以下程序的功能是单击Command1按钮,将输出1~100之间的所有同构数。同构数是指该数出现在它的平方数的右边,如52=25、252=625。
Private Sub Command1_Click( )
Dim i As Integer,ip As Integer
For i=1 To 100
ip= 【9】
If i<10 Then
If 【10】 Then
Print i,ip
End If
Else
If 【11】 Then
Print i,ip
End If
End If
Next i
End Sub