Исходный код
program students;
uses crt;
type
p_student=^student;
student=record
name:string[20];
next:p_student;
end;
var
a:array[1..100] of string;
filestud:text;
head:p_student;
curr:p_student;
buf:string[20];
i:integer;
begin
assign(filestud,'c:\base1.txt');
reset(filestud);
repeat
read(filestud,buf[i]);
i:=i+1;
until
eof(filestud);
close(filestud);
begin
if length(buf[i])<>0 then
begin
new(curr);
curr^.name:=buf[i];
curr^.next:=head;
head:=curr;
end;
while Length(buf[i])=0 do
writeln('Введеный список ');
curr:=head;
while curr<>nil do begin
writeln(curr^.name);
curr:=curr^.next;
end;
readln;
end;
end.
uses crt;
type
p_student=^student;
student=record
name:string[20];
next:p_student;
end;
var
a:array[1..100] of string;
filestud:text;
head:p_student;
curr:p_student;
buf:string[20];
i:integer;
begin
assign(filestud,'c:\base1.txt');
reset(filestud);
repeat
read(filestud,buf[i]);
i:=i+1;
until
eof(filestud);
close(filestud);
begin
if length(buf[i])<>0 then
begin
new(curr);
curr^.name:=buf[i];
curr^.next:=head;
head:=curr;
end;
while Length(buf[i])=0 do
writeln('Введеный список ');
curr:=head;
while curr<>nil do begin
writeln(curr^.name);
curr:=curr^.next;
end;
readln;
end;
end.
Код заключаем в теги !!!