12.04.2013, 14:39
|
|
Местный
|
|
Регистрация: 29.09.2010
Сообщения: 539
Версия Delphi: Delphi XE3
Репутация: 374
|
|
Код:
var
a:array [0..9] of integer;
maxA, minA : integer;
res : real;
begin
randomize;
for i:=0 to 9 do
a[i] := rand(1000);
maxA :=0; minA := 0;
for i:=0 to Length(a) do
begin
if maxA < a[i] then maxA := a[i];
if minA > a[i] then minA := a[i];
end;
res := (maxA + minA) / 2;
Это сообщение изменило мой статус на Активный
|