
11.06.2010, 01:12
|
Прохожий
|
|
Регистрация: 02.06.2010
Сообщения: 17
Репутация: 10
|
|
в месте выделенном красным что у меня не правильно?
Код:
procedure TForm1.Button1Click(Sender: TObject);
const m=3;n=5;
type type=array[1..m,1..n] of real;
var x:type;
i,j:byte;
s,q,w:real;
begin
i:=1;
while i<=stringgrid1.ColCount do
begin
j:=1;
while j<=stringgrid1.RowCount do
begin
x[i,j]:=strtofloat(stringgrid1.Cells[i-1,j-1]);
for i:=1 to m do
begin
s:=0;
if i:=1 then
s:=s+x[i,j];
q:=0;
if i:=2 then
q:=q+x[i,j];
w:=0;
if i:=3 then
w:=w+x[i,j];
label1.Caption:=floattostr(s)+#13+floattostr(q)+#13+floattostr(w);
j:=j+1;
end;
i:=i+1;
end;
end.
|