Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
бассейн
const n = 5; var i, s, max, h, h_next, c : integer; begin s := 0; readln (h); readln (h_next); c := 0; max := h; for i := 1 to n do begin if h <= h_next then begin max := h_next; if c = 0 then begin s := s + h; end else begin if h_next > max then begin s := s + max * c; max := h_next; c := 0; end else begin s := s + h_next * c; end end end else begin c := c + 1; s := s + h_next; end; h := h_next; readln (h_next); end; writeln (s); end.
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
непарное число в массиве
practica 7 ejercicio 11
TanTai11A2@
AgentMaxence
тренировка баскетболиста 2
Gertie
JOZIANE NEVES DE SOUZA 600630041
homework
Trabajo pascal
basketball_player_training
Please log in to post a comment.