运行以下程序后,文件result.txt中的内容为: f=open('c:\\xxy\\result.txt','w') f.write('hello\nworld') f.close()
A.helloworld
B.hello world
C.hello \ n world
D.hello \n world
- · 有4位网友选择 B,占比50%
- · 有3位网友选择 C,占比37.5%
- · 有1位网友选择 A,占比12.5%
A.helloworld
B.hello world
C.hello \ n world
D.hello \n world
A、C盘根目录下
B、D盘根目录下
C、Python安装目录下
D、与源文件在相同的目录下
#include<stdio.h>
main()
(FILE *fr;char str[40];
…
fgets(str,5,fr);
printf("%s\n",str);
fclose(fr);
}
#include
main()
{ FILE *fp;
fp= fopen("test.txt”, ”w+”);
fputs("test",fp);
fclose(fp);
}
#include
main()
{ FILE *fp;
char *s1="Fortran",*s2="Basic";
if((fp=fopen("test.txt","wb ” ))==NULL)
{ printf("Can't open test.txt file\n");exit(1);}
fwrite(s1,7,1,fp); /* 把从地址 s1 开始的 7 个字符写到 fp 所指文件中 */
fseek(fp,0L,SEEK_SET); /* 文件位置指针移到文件开头 */
fwrite(s2,5,1,fp);
fclose(fp);
}
A)Basican
B)BasicFortran
C)Basic
D)FortranBasic
A.Basican
B.BasicFortran
C.Basic
D.FortranBasic
A、gcc编译生成的test可执行程序的内容
B、gcc编译生成的test.o模块文件的内容
C、test可执行程序运行时的输出
D、gcc编译过程中的输出
B、new worldhello
C、new world
D、hello,world
#include<stdio.h>
main()
{FILE *fout; char ch;
four=fopen('abc.txt','w');
ch=fgetc(stdin);
while(ch!='#')
{fputc(ch,fout);
ch=fgetc(stdin);
}
fclose(fout);
}
出错的原因是( )。
A.函数fopen调用形式错误 B.输入文件没有关闭
C.函数fgetc调用形式错误 D.文件指针stdin没有定义
为了保护您的账号安全,请在“简答题”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!