Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Бассейн-5
const n = 5; var h, h_next, max, s, c, v, i : integer; begin readln ( h ); max := h; v := 0; s := 0; c := 1; for i := 2 to n do begin readln( h_next ); if h < h_next then begin if max < h_next then begin v := v + h; max := h_next; end else { max > h_next } begin v := v + c * h_next; s := 0; end; end else { h > h_next } begin s := s + h_next; c := c + 1; end; h := h_next; end; writeln (v + s); end.
run
|
edit
|
history
|
help
0
BubbleSort (standaard)
solar_system_n_planets_any_time
1 задание
Tong chu so
0
1
Tinh tong
Opdracht_1
Excercise3
Задачи к § 66 «Символьные строки» Задача №112336. Замена a-b в последовательности символов