主题:文件-程序纠错,提示错误:FILE NOT FOUND!
program lx17_1(input,output);
var cha:text;
ch:char;
i1,i,j,k:integer;
a:array[1..100] of integer;
begin
writeln('lu jing:');
read(ch);
assign(cha,ch);
reset(cha);
i:=0;
while not eof do
begin
i1:=i1+1;
read(cha,a[i]);
if eoln then readln;
end;
close(cha);
for i:=1 to i1 do
for j:=i+1 to j do
if a[i]<a[j] then
begin
k:=a[i];
a[i]:=a[j];
a[j]:=k;
end;
rewrite(cha);
for i:= 1 to i1 do
writeln(cha);
close(cha);
end.
运行时输入的路径正确,已经有文件存在,但还是提示错误。急救
var cha:text;
ch:char;
i1,i,j,k:integer;
a:array[1..100] of integer;
begin
writeln('lu jing:');
read(ch);
assign(cha,ch);
reset(cha);
i:=0;
while not eof do
begin
i1:=i1+1;
read(cha,a[i]);
if eoln then readln;
end;
close(cha);
for i:=1 to i1 do
for j:=i+1 to j do
if a[i]<a[j] then
begin
k:=a[i];
a[i]:=a[j];
a[j]:=k;
end;
rewrite(cha);
for i:= 1 to i1 do
writeln(cha);
close(cha);
end.
运行时输入的路径正确,已经有文件存在,但还是提示错误。急救