Помогите ради бога!
Спасибо заранее...
program lab1_2;
uses crt;
type
plist = ^tlist;
tlist = record
info: integer;
link: plist;
end;
var first1, posl1: plist;
procedure print(p: plist);
begin
while p <> nil do
begin
write(p^.info);
p := p^.link
end;
writeln;
end;
procedure vvod (var first, last: plist);
var s: integer;
p: plist;
begin
last := first;
repeat
write('Введите следующий элемент: ');
readln(s);
if s <> -999 then
begin
new(p);
p^.info := s;
p^.link := nil;
if first = nil
then
first := p
else last^.link := p;
last := p;
end;
until s = -999;
end;
procedure sort (var first1: plist);
var second, p, t: plist;
begin
if first1^.link = nil then exit;
second:= first1^.link;
sort (second);
p:=second;
if second^.info>first1^.info
then
begin
first1^.link:=second;
exit;
end;
while p^.link <> nil do
begin
t:=p^.link;
if t^.info>first1^.info
then
begin
writeln ('assdfsd sd fsd fsdf ');
first1^.link:=p^.link;
p^.link:=first1;
first1:=second;
break;
end;
p:=p^.link;
end;
end;
begin
clrscr;
writeln('Первый список:');
first1:=nil;
vvod (first1, posl1);
print(first1);
sort (first1);
writeln('Отсортированный список:');
print(first1);
readkey;
end.