SHARE
TWEET

Untitled

a guest Apr 24th, 2019 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var
  2. i,k:integer;
  3. s,m:real;
  4. a :array[1..30] of integer;
  5. begin
  6.       for i:=1 to 30 do
  7.       begin
  8.         readln(a[i]);
  9.       end;
  10.       for i:=1 to 30 do
  11.       begin
  12.           k:=k+a[i];
  13.       end;
  14.       m:=k/30;
  15.       s := 1;
  16.       for i:=1 to 30 do
  17.       begin
  18.           if abs(a[i]-m) < abs(a[s]-m) then
  19.           begin
  20.               s:=i;
  21.           end;
  22.       end;
  23.       writeln(s);
  24. end.
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top