Z
z_j_ren
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TForm1.Button1Click(Sender: TObject);
var
I:integer;
II,J,K,QJB,CSQ,CGQ : Real;
QJ:Array [0..20] of Real;
NJ:integer;
test:Real;
begin
NJ:=13;
QJ[1] :=-1800;
QJ[2] :=34.92;
QJ[3] :=100.44;
QJ[4] :=94.68;
QJ[5] :=137.88;
QJ[6] :=224.64;
QJ[7] :=184.68;
QJ[8] :=201.24;
QJ[9] :=288;
QJ[10]:=285.12;
QJ[11]:=100.8;
QJ[12]:=34.56;
QJ[13]:=113.04;
For I := 1 to NJdo
begin
if (QJ>=0) then
begin
CGQ:=CGQ+QJ;
end
else
begin
test:=ABS(QJ);
CSQ:=CSQ+ABS(QJ);
end;
end;
if CSQ=CGQ then
//调试时,这里的CSQ和CGQ都是1800,但是程序不执行QJB:=0
QJB:=0 //而是执行QJB:=CSQ-CGQ,并且QJB不为0
else
QJB := CSQ-CGQ;
end;
请各位大侠帮帮忙!
var
I:integer;
II,J,K,QJB,CSQ,CGQ : Real;
QJ:Array [0..20] of Real;
NJ:integer;
test:Real;
begin
NJ:=13;
QJ[1] :=-1800;
QJ[2] :=34.92;
QJ[3] :=100.44;
QJ[4] :=94.68;
QJ[5] :=137.88;
QJ[6] :=224.64;
QJ[7] :=184.68;
QJ[8] :=201.24;
QJ[9] :=288;
QJ[10]:=285.12;
QJ[11]:=100.8;
QJ[12]:=34.56;
QJ[13]:=113.04;
For I := 1 to NJdo
begin
if (QJ>=0) then
begin
CGQ:=CGQ+QJ;
end
else
begin
test:=ABS(QJ);
CSQ:=CSQ+ABS(QJ);
end;
end;
if CSQ=CGQ then
//调试时,这里的CSQ和CGQ都是1800,但是程序不执行QJB:=0
QJB:=0 //而是执行QJB:=CSQ-CGQ,并且QJB不为0
else
QJB := CSQ-CGQ;
end;
请各位大侠帮帮忙!