Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,37 @@
program LongestStringChallenge_1(input, output);
var
Line: string;
Lines: array of string;
position, len: integer;
begin
if not eoln(input) then
begin
len := 1;
position := 0;
readln (line);
setlength(lines, len);
lines[position] := line;
while not eoln(input) do
begin
readln (line);
if length(line) = length(lines[0]) then
begin
inc(position);
inc(len);
setlength(lines, len);
lines[position] := line;
end;
if length(line) > length(lines[0]) then
begin
position := 0;
len := 1;
setlength(lines, 1);
lines[0] := line;
end;
end;
for position := low(lines) to high(lines) do
writeln (lines[position]);
end;
end.

View file

@ -0,0 +1,43 @@
program LongestStringChallenge_2(input, output);
{$mode ObjFPC}
{$rangechecks on}
uses
SysUtils;
var
Line: ANSIstring;
Lines: array of ANSIstring;
position: integer;
tester: char;
begin
if not eoln(input) then
begin
readln (line);
position := 0;
setlength(lines, 1);
lines[0] := line;
while not eoln(input) do
begin
readln (line);
try
tester := lines[0][length(line)];
try
tester := line[length(lines[0])];
inc(position);
setlength(lines, succ(position));
lines[position] := line;
except
end;
except
position := 0;
setlength(lines, 1);
lines[0] := line;
end;
end;
for position := low(lines) to high(lines) do
writeln (lines[position]);
end;
end.