Run Code
|
API
|
Code Wall
|
Users
|
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
Please
log in
to post a comment.
LISTNAME
1 2 9
Урок 2. Функции
подсчёт символов и цифр пока не точка
f1
Homework 8
3
1
solar sysmtem 6 (with random mass m1)
nomer4
Please log in to post a comment.