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
test27
practica 11 ejercicio 5
Object Pascal
ruteo
https://m.facebook.com/
123456
Vremenska prognoza
RAMON BARBOSA DE ARAUJO CONCEIÇÃO 600623124
practica 6 ejercicio 3
Поиск вершин в горах