Код
var
str, str1, str2: array [1..100] of string;
num: array [1..100] of integer;
i, j, t, k, n, m, h, num1, l: integer;
p: set of char;
begin
(*Vvod*)
write ('Vvedite kollichestvo strok: ');
readln (k);
for i:=1 to k do
begin
write ('Vvedite ',i, ' stroky: ');
readln (str[i]);
end;
p:=['1','2','3','4','5','6','7','8','9','0'];
(*Telo*)
n:=0;
for i:=1 to k do
begin
t:=0;
for j:=1 to length (str[i]) do
begin
if (str[i][j] in p) then
begin
if (j-t)>1 then
begin
inc (n);
str1[n]:=copy(str[i], t+1, j-t-1);
num[n]:=i;
end;
t:=j;
end;
end;
end;
(*Vuvod*)
for i:=1 to n do
begin
writeln ('Rezyltat: ', str1[i]);
writeln ('Num: ', num[i]);
end;
(*Zadanie 2*)
h:=32768;
for i:=1 to n do
begin
m:=0;
for j:=1 to length (str1[i]) do
begin
if (str1[i][j]>'a') AND (str1[i][j]<'z') then
begin
inc(m);
end;
end;
if h>m then
begin
h:=m;
num1:=i;
end;
end;
(*Vuvod 2*)
writeln ('Rezyltat 2: Chislo latinskih simvolov: ' , h, ' Num: ', num1, ' Str: ', str1[num1]);
(*Zadanie 3*)
l:=0;
for i:=1 to length (str[num[num1]]) do
begin
str2[i]:=str[num[num1]];
end;
for i:=1 to n do
begin
if str2[i]='1' then
begin
str2[i]:='A';
end;
if str2[i]='2' then
begin
str2[i]:='B';
end;
if str2[i]='3' then
begin
str2[i]:='C';
end;
if str2[i]='4' then
begin
str2[i]:='D';
end;
if str2[i]='5' then
begin
str2[i]:='E';
end;
if str2[i]='6' then
begin
str2[i]:='F';
end;
if str2[i]='7' then
begin
str2[i]:='G';
end;
if str2[i]='8' then
begin
str2[i]:='H';
end;
if str2[i]='9' then
begin
str2[i]:='I';
end;
end;
for i:=1 to n do
begin
writeln ('Rezyltat 3: ', str2[i]);
end;
end.