Var a: array [1..100] of integer;
n, i, j: integer;
fout: text;
begin
assign(fout, 'output.txt');
rewrite(fout);
n := 10; //n - длина массива
for i := 1 to n do
a[i] := random(100);
for i := 1 to n do
write(fout, a[i], ' ');
writeln(fout);
j := 1;
for i := 2 to n do
if a[i] > a[j] then
j := i;
writeln(fout, 'max = ', a[j], ' max_ind = ', j);
j := 1;
for i := 2 to n do
if a[i] < a[j] then
j := i;
writeln(fout, 'min = ', a[j], ' min_ind = ', j);
close(fout);
<span>end.</span>
11101(2)=29(10)
10(2)=2(10)
29+2=31(10) = 11111(2)
29-2=27 = 11011(2)
29*2=58 = 111010(2)
11001(2) + 10(2) = 11111(2) =31(10)
10101(2) - 10(2) = 11011(2) = 27(10)
11101(2) * 10(2) = 111010(2) = 58(10)
// PascalABC.NET 3.1, сборка 1218 от 12.04.2016
uses GraphABC;
procedure OutLightGreen(n:integer);
begin
var OldColor:=FontColor;
SetFontColor(clLightGreen);
Write(n:5);
SetFontColor(OldColor)
end;
begin
var a:=MatrixRandom(10,14,-180,320);
var m:=ReadInteger('n=');
Writeln;
SetFontColor(clWhite);
Font.Style:=fsBold; Font.Name:='Courier';
Brush.Color:=clBlack; Window.Clear(clBlack);
var k:=0;
for var i:=0 to 9 do begin
for var j:=0 to 13 do
if a[i,j]>m then begin
Inc(k); OutLightGreen(a[i,j]) end
else Write(a[i,j]:5);
Writeln
end;
SetFontColor(clRed);
Writeln('Количество элементов равно ',k)
end.