Помогите! Почему не работает программа в ABC Pascale
program Project1;
type
t_pub = record
cost: integer;
case t: char of
'a': (name:string[20]);
'v': (treh:integer);
'l': (mot:integer);
end;
var
catalog: array[1..20] of t_pub;
n,i,cv,cl,b: integer;
begin
cv:= 0;
cl:= 0;
b:= 0;
write('????: ');
readln(n);
for i:=1 to n do begin
write('????(a,v,l): ');
readln(catalog.t);
write('????: ');
readln(catalog.cost);
case catalog.t of
'a': begin
write('????: ');
readln(catalog.name);
end;
'v': begin
write('????1/0: ');
readln(catalog.treh);
end;
'l': begin
write('????1/0: ');
readln(catalog.mot);
end;
end;
writeln;
end;
for i:=1 to n do
with catalog do
if (t = 'v') and (treh = 1) then
cv := cv + cost;
writeln('????= ', cv);
for i:=1 to n do
with catalog do
if (t = 'a') and (name = 'Niva') or (name = '????') or (name = '????') or (name = 'niva') then
b:= 1;
if (b = 1) then
writeln('????')
else
writeln('????');
for i:=1 to n do
with catalog do
if (t = 'l') and (mot = 1) then
cl := cl + cost;
writeln('????= ', cl);
readln;
end.