Program Massive;
uses Crt;
const
K = 3;
L = 6;
var
Z: array [1..K * L] of integer;
R: array [1..K * L] of integer;
Q: array [1..K * L] of integer;
i: integer;
x: integer;
begin
Randomize;
x := K * L;
for i:= 1 to x do
Z[i] := Random(20);
R[i] := Random(10);
end;
ClrScr;
writeln('Massive Z:');
write(Z[i]:4);
writeln;
writeln('Massive R:');
write(R[i]:4);
Q[i]:= Z[i] * R[i] + 10;
writeln('Massive Q:');
write (Q[i]:4);
readln
end.
var
s: string;
i, count: integer;
begin
writeln('Vvedite stroky: ');
readln(s);
for i := 1 to length(s) - 2 do
if copy(s, i, 3) = 'abc' then
count := count + 1;
writeln('Kol-vo: ', count);
end.
2.
var
s1, s2: string;
i, len1, len2: integer;
begin
writeln('Vvedite stroky 1: ');
readln(s1);
writeln('Vvedite stroky 2: ');
readln(s2);
len1 := length(s1);
len2 := length(s2);
if len1 > len2 then writeln('1 stroka dlinnee')
else if len1 < len2 then writeln('2 stroka dlinnee')
else writeln('dlini strok ravnie')
end.
3.
var
s1, s2, s3: string;
begin
writeln('Vvedite stroky 1: ');
readln(s1);
writeln('Vvedite stroky 2: ');
readln(s2);
s3 := s1[1] + s1[2] + s2[1] + s2[2];
writeln('Novaja stroka: ', s3);
end.
Program Massive;
uses Crt;
const
K = 3;
L = 6;
var
Z: array [1..K * L] of integer;
R: array [1..K * L] of integer;
Q: array [1..K * L] of integer;
i: integer;
x: integer;
begin
Randomize;
x := K * L;
for i:= 1 to x do
begin
Z[i] := Random(20);
R[i] := Random(10);
end;
ClrScr;
writeln('Massive Z:');
for i:= 1 to x do
write(Z[i]:4);
writeln;
writeln('Massive R:');
for i:= 1 to x do
write(R[i]:4);
writeln;
for i:= 1 to x do
Q[i]:= Z[i] * R[i] + 10;
writeln('Massive Q:');
for i:= 1 to x do
write (Q[i]:4);
readln
end.