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 + c * max; max := h_next; s := 0; 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
вариант 6, номер 1
For8
hh
Task1-1
Huong11a2@
08 Ariketa WHILE
tarea1
Ejercicio SQRT
BubbleSor (slimst)
test23