Const N = 13; Var A:array[1..N] of integer; i,j:integer; Begin For i:= 1 to N do Begin A[i]:=random(21)-10; Write(A[i],' '); End; WriteLn; For j:= 1 to N do For i:= 1 to N-1 do if A[i]<A[i+1] then Swap(A[i],A[i+1]); For i:= 1 to N do Write(A[i],' ');
End.
2)
Var A:array[1..4,1..4] of integer; i,j:integer; Begin For i:= 1 to 4 do Begin For j:= 1 to 4 do Begin if (i+j) mod 2 = 0 then A[i,j]:=i*j else A[i,j]:=i+j; Write(A[i,j],' ') End; WriteLn End; End.
Const
N = 13;
Var
A:array[1..N] of integer;
i,j:integer;
Begin
For i:= 1 to N do
Begin
A[i]:=random(21)-10;
Write(A[i],' ');
End;
WriteLn;
For j:= 1 to N do
For i:= 1 to N-1 do
if A[i]<A[i+1] then Swap(A[i],A[i+1]);
For i:= 1 to N do
Write(A[i],' ');
End.
2)
Var
A:array[1..4,1..4] of integer;
i,j:integer;
Begin
For i:= 1 to 4 do
Begin
For j:= 1 to 4 do
Begin
if (i+j) mod 2 = 0 then A[i,j]:=i*j
else A[i,j]:=i+j;
Write(A[i,j],' ')
End;
WriteLn
End;
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.