Reset f1 Reset f2 While not EOF f1 do begin Readln f1 st1 length st1 i

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Reset(f1);
Reset(f2);
While not(EOF(f1)) do
begin
Readln(f1,st1);
l := length(st1);
if (st1[l] in vowels) then
begin
i := 1;
x := random(1,n - 1);
While (i <= x) do
begin
Readln(f2,st2);
st2 := st2 + 'овна ';
Name := st1 + ' ' + st2;
inc(i);
end;
end;
if not (st1[l] in vowels) then
begin
i := 1;
x := random(1,n - 1);
While (i <= x) do
begin
Readln(f2,st2);
st2 := st2 + 'ович ';
Name := st1 + ' ' + st2;
inc(i);
end;
end;