ty [BCity]. Name <> st) do inc (BCity);
until BCity <> MaxCity;
repeat
write ('Кінцевий місто ...');
readln (st);
Ecity: = 1; while (ECity st) do inc (ECity);
until Ecity <> MaxCity;
repeat
gotoxy (1,5);
WriteLn ('Дата відправлення:');
DTInput (a);
delay: = a.Dweek * 1440 + a.time;
Write ('Максимальний час шляху (Доба): ');
readln (w);
waytime: = round (1440 * w);
until waytime> 0;
write ('Максимальна вартість ...');
ReadLn (cost);
write ('Максимальне число пересадок ... '); p> readln (reboading);
write ('Тип перевезення (авіа, ж.д., авто, водн.) ... '); p> readln (st);
if st ='' then for i: = 1 to 4 do kind [i]: = true else
for i: = 1 to 4 do kind [i]: = (st [i] = 'Y') or (st [i] = 'y') or (st [i] = 'X') or (st [i] = 'x');
write ('Допустимі класи 123456 ...');
readln (st);
if st ='' then for i: = 1 to 4 do class [i]: = true else
for i: = 1 to 4 do class [i]: = (st [i] = 'Y') or (st [i] = 'y') or (st [i] = 'X') or (st [i] = 'x');
end;
end;
procedure outres (p: Answerlist; a: dat);
var k: word; q: link; b: dat; i: citycode; y: pway; c: byte;
begin
k: = 0;
while P <> nil do begin
inc (k);
{write (p ^. path ^. bcity);}
Q: = P ^. path;
b: = a;
while Q <> nil do begin
write (city [q ^. bcity]. name);
Writeln (' <', Q ^. Flight ^. Company, q ^. Flight ^. Number,'> ', city [Q ^. Target]. Name);
newdat (b, Q ^. ddelay, b);
write ('Відправлення:'); writedat (b);
newdat (b, Q ^. waytime, b);
write ('Прибуття:'); writedat (b); writeln;
Q: = Q ^. last;
end;
newdat (a, p ^. waytime, b);
writeln ('ціна:', P ^. mincost, '- ', P ^. Maxcost);
readln (st);
if st = 'p' then begin
graphout (city);
q: = p ^. path;
c: = 2;
while q <> nil do begin
i: = 1;
y: = q ^. flight ^. path;
while y ^. way [i]. city <> q ^. bcity do begin
i: = (i mod 4) +1; if i = 1 then y: = y ^. next;
end;
setcolor (c);
moveto (4 * city [q ^. bcity]. x ,380-3 * city [q ^. bcity]. y);
repeat
i: = (i mod 4) +1; if i = 1 then y: = y ^. next;
lineto (4 * city [y ^. way [i]. city]. x ,380-3 * city [y ^. way [i]. city]. y);
until (y ^. way [i]. city = q ^. target);
Q: = Q ^. last; inc (c);
end; repeat until keypressed; CloseGraph;
end;
P: = P ^. next;
end;