Tin học Pascal debug help!!

Dũng8a7

Học sinh mới
Thành viên
10 Tháng hai 2020
10
1
6
17
Bình Phước
Trường TH & THCS Lương Thế Vinh
[TẶNG BẠN] TRỌN BỘ Bí kíp học tốt 08 môn
Chắc suất Đại học top - Giữ chỗ ngay!!

ĐĂNG BÀI NGAY để cùng trao đổi với các thành viên siêu nhiệt tình & dễ thương trên diễn đàn.

Mình bị lỗi " exited with exitcode = 201 " giúp mình với ạ .Cảm ơn mọi người!!
File code:
Mã:
uses crt;
var f:text;
    a:array[1..1000] of integer;
    i,j,n,tong,tam:integer;
procedure tinhtong;
begin
for i:=1 to n do
tong:=tong+a[i];
writeln(f,tong);
end;
procedure giamdan;
begin
if a[i]<a[j] then
for i:=1 to n-1 do
for j:=i+1 to n do
write(f,a[i]:2);
end;
procedure tangdan;
begin
if a[i]>a[j] then
for i:=1 to n-1 do
for j:=i-1 to n do
write(f,a[i]);
end;
begin
assign(f,'tonghopday.inp');
reset(f);
readln(f,n);
for i:=1 to n do
read(f,a[i]);
assign(f,'tonghopday.out');
rewrite(f);
tinhtong;
if a[1] mod 2 = 0 then tangdan
else if a[1] mod 2 <> 0 then giamdan;
close(f);
end.
 
Top Bottom