Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const n = 10;
- var a: array[1..n] of real;
- i,k: integer;
- S,max: real;
- begin
- for i := 1 to n do read(a[i]);
- max := a[1];
- for i := 2 to n do
- if a[i] > max then
- begin
- max := a[i];
- k := i;
- end;
- dec(k);
- for i := 1 to k do S := S + a[i];
- writeln(S/k)
- end.
Advertisement
Add Comment
Please, Sign In to add comment