Дамп всех задач
This commit is contained in:
23
Pascal/03.11.16/Program14.pas
Normal file
23
Pascal/03.11.16/Program14.pas
Normal file
@@ -0,0 +1,23 @@
|
||||
const
|
||||
N = 30;
|
||||
|
||||
var
|
||||
a: array [1..N] of integer;
|
||||
i, k, max, max2: integer;
|
||||
|
||||
begin
|
||||
Randomize();
|
||||
for i := 1 to N do begin a[i] := Random(9);write(a[i], ' '); end;
|
||||
writeln();
|
||||
k := 0;
|
||||
max := 0;
|
||||
max2 := 0;
|
||||
for i := 1 to N do
|
||||
begin
|
||||
if a[i] > max then begin
|
||||
max2 := max;
|
||||
max := a[i];
|
||||
end;
|
||||
end;
|
||||
writeln(max2);
|
||||
end.
|
||||
Reference in New Issue
Block a user