program test;
var
source: text; name: string; line: string; count: integer;
begin
write('write name of file (for example 1.txt): '); read(name);
assign(source, name); reset(source);
count := 0;
while not eof(source) do begin
readln(source, line);
count := count + 1;
end;
writeln('Lines count: ', count);
close(source);
end.
program test;
var
source: text;
name: string;
line: string;
count: integer;
begin
write('write name of file (for example 1.txt): ');
read(name);
assign(source, name);
reset(source);
count := 0;
while not eof(source) do
begin
readln(source, line);
count := count + 1;
end;
writeln('Lines count: ', count);
close(source);
end.