PASCAL文件出错

来源:百度知道 编辑:UC知道 时间:2024/06/01 02:46:48
program count(input,output);
type
data=record
dat:longint;
num:longint;
end;
arr=array [1..200000] of longint;
var
a:arr;
b:array [1..10000] of data;
i,m,n:longint;
fi,fo:text;
procedure quicksort(var a:arr;s,t:longint);
var
i,j,x:longint;
begin
i:=s;
j:=t;
x:=a[i];
repeat
while (a[j]>=x) and (i<j) do
dec(j);
if i<j then
begin
a[i]:=a[j];
inc(i);
end;
while (a[i]<=x) and (i<j) do
inc(i);
if i<j then
begin
a[j]:=a[i];
dec(j);
end;
until i=j;
a[i]:=x;
if i-1>s then
quicksort(a,s,i-1);
if i+1>s then
quicksort(a,i+1,t);
end;
procedure deal;
var
i:longint;
begin
fillchar(b,length(b),0);
m:=1;
for i:

...这个题目....
为什么要这样操作文件呢...
既然只是要求文件输入输出...
这样最好了:
把fi fo 都去掉,先写一个不带文件的。然后开文件用
assign(input,'count.in');
assign(output,'count.out');
reset(input);
rewrite(output);

最后
close(input);
close(output);
就可以了

运行错误2,是文件的,你看看有没有count.in文件
好像要在fp目录下才行,看看是不是真的是count.in,有可能文件本来是count.in.txt