• 2022-10-24
    为了读取数据,需打开顺序文件“D:\data5.txt”,以下正确的命令是
    A: Open D:\data5.txt For Input As #1
    B: Open "D:\data5.txt"For Input As #2
    C: Open D:\data5.txt For Output As #1
    D: Open "D:\data5.txt"For Output As #2
  • B

    内容

    • 0

      要从磁盘上读入一个文件名为"d:\File.txt"的顺序文件,下面程序段正确的是( ). A: Open d:\File.txt For Input As B: 1 C: Open "d:\File.txt" For Output As D: 2 E: Open "d:\File.txt" For Input As F: 2 G: Open "d:\File.txt" For Append As H: 1

    • 1

      用( )语句打开顺序文件File1.txt后,可以进行写操作 A: Open "File1.txt" For Input As B: 1 C: Open "File1.txt" For Output As D: 1 E: Open "File1.txt" For Random As F: 1 G: Open "File1.txt" For Binary As H: 1

    • 2

      要从磁盘上读入一个文件名为“c:\t1.txt” 的顺序文件,下列(  )是正确的语句 A: F = "c:\t1.txt" , Open F For Input As #2 B: F ="c:\t1.txt" , Open "F" For Input As #2 C: Open c:\t1.txt For Input As #2 D: Open "c:\t1.txt" For Output As #2

    • 3

      已知文件'1'中有两行文本,第一行是'12',第二行是'34',然后fp=open('1'); fp.read(1); txt=fp.readline();此时变量txt的内容是 A: '1' B: '2' C: '2\n' D: '12\n'

    • 4

      下列哪一种是以顺序文件方式打开文件并进行写操作( ). A: Open "c:\file1.dat" For Output as B: 1 C: Open "c:\file1.dat" For Input as D: 1 E: Open "c:\file1.dat" For Print as F: 1 G: Open "c:\file1.dat" For Write as H: 1