Ответ:
program Pascal;
const n=10;
Var i,max,max2,max3: Integer;
m: array[1..10] of integer;
Begin
m[1]:=random(10);
max:=m[1];
max2:=m[1];
max3:=m[1];
For i:=2 to n do
begin
m[i]:=random(100);
write(m[i]:4);
end;
For i:=1 to n do
if (m[i]>max) then
max3:=max2;
max2:=max;
max:=m[i];
end
else if (m[i]>max2) then
max2:=m[i];
else if (m[i]>max3) then
max3:=m[i];
writeln();
writeln(max3);
End.
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Ответ:
program Pascal;
const n=10;
Var i,max,max2,max3: Integer;
m: array[1..10] of integer;
Begin
m[1]:=random(10);
max:=m[1];
max2:=m[1];
max3:=m[1];
For i:=2 to n do
begin
m[i]:=random(100);
write(m[i]:4);
end;
For i:=1 to n do
begin
if (m[i]>max) then
begin
max3:=max2;
max2:=max;
max:=m[i];
end
else if (m[i]>max2) then
begin
max3:=max2;
max2:=m[i];
end
else if (m[i]>max3) then
begin
max3:=m[i];
end;
end;
writeln();
writeln(max3);
End.