网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
设有一文本文件test.txt,其内容为"cprogram"(不包含引号),以下程序段的运行结果是()。
A.cpro
B.cprog
C.progr
D.cprogram
参考答案
更多 “ 设有一文本文件test.txt,其内容为cprogram(不包含引号),以下程序段的运行结果是()。 A.cproB.cprogC.progrD.cprogram ” 相关考题
考题
在当前目录存在文本文件test.txt,内容是: Life is short, you need Python. Simple is better than complex. 执行下列语句输出得到的结果是以下哪一项? with open('test.txt', 'r+') as fp: fp.seek(15) print(fp.readline())A.Life is short, you need Python.B.you need Python.C.Simple is better than complex.D.输出为空。
考题
文件test.txt的内容是一段文本:hello,与以下代码在同一目录下,程序运行的输出结果是: f = open('test.txt') print(f.read(2)) f.close()
考题
文件test.txt的内容是一段文本:hello,与以下代码在同一目录下,程序运行的输出结果是: f = open('test.txt') f.seek(2) print(f.read(3)) f.close()
考题
文件test.txt的内容是一段文本:hello,与以下代码在同一目录下,程序运行的输出结果是()。 f = open('test.txt') print(f.read(2)) f.close()
考题
在以下open语句中哪一项无法对文本文件test.txt进行内容删除或修改?A.fp = open('test.txt', 'r+')B.fp = open('test.txt', 'a')C.fp = open('test.txt', 'r')D.fp = open('test.txt', 'w')
考题
【填空题】文本文件quiz.txt的内容为"Programming" (不包含引号),以下程序段的运行结果是_________________ FILE *fp; char *str; if((fp=fopen("quiz.txt","r"))!=NULL) str=fgets(str,7,fp); printf("%s",str);
考题
设有以下程序段 char a[20]; scanf("%s", a); printf("%s", a); 运行时若输入字符串"Wang wei",其输出结果是()。A.WangB.weiC.Wang weiD.程序错误
考题
在当前目录存在文本文件test.txt,内容是: Life is short, you need Python. Simple is better than complex. 执行语句 fp = open('test.txt', 'r+') fp.seek(15) print fp.readline()输出得到的结果是以下哪一项?A.Life is short, you need Python.B.you need Python.C.Simple is better than complex.D.输出为空。
热门标签
最新试卷