Ответ:
program task;
const n = 31;
var
a: array [1..n] of integer;
max, min, i : integer;
begin
for i:=1 to 31 do
readln (a[i]);
max:= a[1];
min := a[1];
for i:= 2 to 31 do
if ( a[i] > max ) then
max:= a[i];
for i:=2 to 31 do
if (a[i] < min) then
min := a[i];
writeln('Max: ');
write(max);
writeln('Min: ');
write(min);
end.
Объяснение:
Вроде так
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Ответ:
program task;
const n = 31;
var
a: array [1..n] of integer;
max, min, i : integer;
begin
for i:=1 to 31 do
readln (a[i]);
max:= a[1];
min := a[1];
for i:= 2 to 31 do
if ( a[i] > max ) then
max:= a[i];
for i:=2 to 31 do
if (a[i] < min) then
min := a[i];
writeln('Max: ');
write(max);
writeln('Min: ');
write(min);
end.
Объяснение:
Вроде так