Spicke

на2

Jan 17th, 2017
574
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.32 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.     for i := 2 to n do
  12.     if(a[i] > max) or (a[i] = max) then
  13.     begin
  14.       max := a[i];
  15.       inc(k);
  16.     end;
  17.    
  18.     S := (max*k)/k;
  19.     writeln(S)
  20. end.
Advertisement
Add Comment
Please, Sign In to add comment