
05.07.2009, 00:30
|
 |
Активный
|
|
Регистрация: 12.09.2008
Сообщения: 275
Репутация: 43
|
|
вотава
Код:
procedure TForm1.Button4Click(Sender: TObject);
var
min, max, diapazon, d1, d2, d3, d4, d5, c, r : integer;
begin
Max := aa[1,1];
Min := aa[1,1];
d1:=0;
d2:=0;
d3:=0;
d4:=0;
d5:=0;
for c := 1 to 20 do
for r := 1 to 20 do
begin
if Max < aa[c, r] then Max := aa[c, r];
if Min > aa[c, r] then Min := aa[c, r];
end;
diapazon:=round((max-min) / 5);
for c := 1 to 20 do
for r := 1 to 20 do
begin
if (min <= aa[c, r]) and (aa[c, r]<=diapazon) then inc(d1);
if (diapazon < aa[c, r]) and (aa[c, r]<=diapazon*2) then inc(d2);
if (diapazon*2 < aa[c, r]) and (aa[c, r]<=diapazon*3) then inc(d3);
if (diapazon*3 < aa[c, r]) and (aa[c, r]<=diapazon*4) then inc(d4);
if (diapazon*4 < aa[c, r]) and (aa[c, r]<=max) then inc(d5);
end;
LABEL6.Caption:='MIN = '+ IntToStr(MIN);
LABEL7.Caption:='MAX = '+ IntToStr(MAX);
LABEL1.Caption:='diap1 = '+ IntToStr(d1);
LABEL2.Caption:='diap2 = '+ IntToStr(d2);
LABEL3.Caption:='diap3 = '+ IntToStr(d3);
LABEL4.Caption:='diap4 = '+ IntToStr(d4);
LABEL5.Caption:='diap5 = '+ IntToStr(d5);
end;
|