1. var a:array[1..10] of integer;
i,pr:integer;
begin
randomize;
pr:=1;
for i:= 1 to 10 do
a[i]:=random(10);
for i:=1 to 10 do
if i mod 2<>0 then pr:=pr*a[i];
write('Массив:');
write (A[i],' ');
writeln('Произведение= ',pr);
end.
2. var a:array[1..10] of integer;
i,max,min:integer;
max:=0; min:=30000;
if a[i]>max then max:=a[i];
if a[i]<min then min:=a[i];
end;
write('Разность=',max-min);
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
1. var a:array[1..10] of integer;
i,pr:integer;
begin
randomize;
pr:=1;
for i:= 1 to 10 do
a[i]:=random(10);
for i:=1 to 10 do
if i mod 2<>0 then pr:=pr*a[i];
write('Массив:');
for i:=1 to 10 do
write (A[i],' ');
writeln('Произведение= ',pr);
end.
2. var a:array[1..10] of integer;
i,max,min:integer;
begin
randomize;
max:=0; min:=30000;
for i:= 1 to 10 do
a[i]:=random(10);
for i:=1 to 10 do
begin
if a[i]>max then max:=a[i];
if a[i]<min then min:=a[i];
end;
write('Разность=',max-min);
end.