Spicke

на3

Jan 17th, 2017
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.33 KB | None | 0 0
  1. const n = 10;
  2.  
  3. var a: array[1..n] of real;
  4.     i,k: integer;
  5.     S,max: real;
  6.  
  7. begin
  8.     for i := 1 to n do read(a[i]);
  9.     max := a[1];
  10.    
  11.    
  12.     for i := 2 to n do
  13.     if a[i] > max then
  14.     begin
  15.       max := a[i];
  16.       k := i;
  17.     end;
  18.     dec(k);
  19.     for i := 1 to k do S := S + a[i];
  20.     writeln(S/k)
  21. end.
Advertisement
Add Comment
Please, Sign In to add comment