Pascal读入文件

2025-04-29 11:56:18
推荐回答(4个)
回答1:

var
st,st2:string;
f:text;
begin
while true do
begin
readln(st);
while (st = '') do readln(st);
assign(f,st);
reset(f);
while (not eof(f)) do
begin
readln(f,st2);
writeln(st2);
end;
close(f);
end;
end.

回答2:

assign(input,'a.txt');
reset(input);

{最后}close(input);

assign(input,'bcdtxt');
reset(input);

{最后}close(input);

assign(input,'pascal.txt');
reset(input);

{最后}close(input);

回答3:

assign(input,'a.txt');
reset(input);

程序体1

close(input);

assign(input,'bcdtxt');
reset(input);

程序体2

close(input);

assign(input,'pascal.txt');
reset(input);

程序体3

close(input);

回答4:

assign(AA,'a.txt');