Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Поиск вершин в горах
const n = 20; var h1, h2, h3, c, i, temp : integer; h_max : array [1..n] of integer; begin randomize; for i := 1 to n do h_max[i] := 0; h1 := 10+random(20); //read(h1); h2 := 10+random(20); //read(h2); write(h1:3,h2:3); if h1 >= h2 then h_max[1] := h1; c := 2; for i := 2 to n-1 do begin h3 := 10+random(20); //read(h3); write(h3:3); if (h2 >= h1) and (h2 >= h3) then h_max[c] := h2; c := c + 1; h1 := h2; if i = n-1 then temp := h2; h2 := h3; end; writeln; if h3 >= temp then h_max[n] := h3; for i := 1 to n do write(h_max[i]:3); writeln; end.
run
|
edit
|
history
|
help
0
Chouain
Elevador Versão Pascal StringList
Prvi zadatak vezbe pokazivaci
qqqq3
nomer1
jugando
звёздное небо с подсчётом двойных звёзд
Angles
pizza
nomer5