设名为“test.txt”的文本文件的内容是123ABCxyzDEF。写出下列程序的输出结果。#include"stdio.h"

作者:高老师 浏览 0

设名为“test.txt”的文本文件的内容是123ABCxyzDEF。写出下列程序的输出结果。
#include"stdio.h"
main()
{FILE*fp;
charch;
if((fp=fopen("test.txt","r+"))==NULL)
{printf("Filenotopen!\n");exit(O);}
while(!feof(fp))
{ch=fgetc(fp);
if(ch>='0'&&ch<='a')
{fseek(fp,一1L,1);fputc(ch+2,fp);
fseek(fp,0L,1);
}
}
rewind(fp);
while(!feof(fp))printf("%c",fgetc(fp));
fclose(fp);
}
【正确答案】:345CDExyzFGH

📱 扫码体验刷题小程序

微信小程序二维码

扫一扫使用我们的微信小程序

热门题目

已复制到剪贴板