![]() |
|
#1
|
|||
|
|||
![]() В общем я не помню задания (но не в этом суть)
Подскажите как вставить массив в мемо чтоб не нарушать комбобокс Код:
function sr(a:mas;N:integer):real; var S:real; i:Integer; begin s:=0; For i:=0 to (N-1) do s:=s+a[i]; Sr1:=s/n; sr:=sr1; end; function ot(a:mas;n:integer):mas; var i:integer; begin for i:=0 to (N-1) do O[i]:=a[i]-sr1; ot:=o; end; function maximum (a:mas;n:integer):real; var i,max:Integer; begin max := 1; for i := 2 to n do if a[i] > a[max] then max := i; Result:=max; end; procedure TForm1.Button1Click(Sender: TObject); var a:mas; z,i,m,n:integer; begin n:=memo1.lines.count; for i:=0 to (n-1) do a[i]:=strtoint(memo1.lines[i]); case sign.ItemIndex of 0:label1.caption:=floattostr(sr(a,n)); 1:label1.caption:=floattostr(ot(a,n)); 2:label1.caption:=floattostr(maximum(a,n)); end; end; end. 1:label1.caption:=floattostr(ot(a,n)); вот что с этим делать |