发布网友 发布时间:2024-10-02 17:30
共3个回答
热心网友 时间:2024-11-22 00:41
2楼的程序有问题,在于如果一行多于256个字符则会出错。
如这样的文件:
从这里开始
0123456701234567012345670123456701234567012345670123456701234567012345670123456701234567012345670123456701234567012345670123456701234567012345670123456701234567012345670123456701234567012345670123456701234567
到这里结束
procere copyfile(p1,p2:string);
var
f1,f2:file of byte;
n:byte;
begin
assign(f1,p1); reset(f1);
assign(f2,p2); rewrite(f2);
while not eof(f1) do begin
read(f1,n);write(f2,n);
end;
close(f1); close(f2);
end;
procere delfile(p:string);
var f:file of byte;
begin
assign(f,p); erase(f);
end;
procere movefile(p1,p2:string);
begin
copyfile(p1,p2); delfile(p1);
end;
begin
copyfile('D:\a.txt','D:\b.txt');
delfile ('D:\b.txt');
movefile('D:\a.txt','D:\c.txt');
end.
热心网友 时间:2024-11-22 00:42
1.var str:string;
begin
assign(input,'d:\a.txt'); reset(input);
assign(output,'d:\b.txt'); reset(output);
while not eof(input) do
begin
readln(str);
writeln(str);
end;
close(input);
close(output);
end.
2.var str:string;
begin
assign(input,'d:\b.txt'); reset(input);
close(input);
erase(input); {删除d:\b.txt}
end.
3.var str:string;
begin
assign(input,'d:\a.txt'); reset(input);
assign(output,'d:\c.txt'); reset(output);
while not eof(input) do
begin
readln(str);
writeln(str);
end;
close(input);
erase(input); {删除d:\a.txt}
close(output);
end.
未编译,应该是对的
热心网友 时间:2024-11-22 00:42
先找到左上角的小图标,在点一下他,选择“编辑”,单击选定,在框住复制的文字,在点一下小图标,选择“编辑”,单击复制,就可以在Windows下粘贴了!