Srfgsrfgfd



Yüklə 349,5 Kb.
səhifə13/14
tarix13.09.2023
ölçüsü349,5 Kb.
#143119
1   ...   6   7   8   9   10   11   12   13   14
Delphi String grid

procedure TForm1.BitBtn1Click(Sender: TObject);
var
I,j: Integer;
begin
s1:=0; s2:=0;
for I := 1 to m1 do
for j := 1 to m1 do
begin
s1:= s1+ StrToFloat(StringGrid1.Cells[i,j]);
end;
for I := 1 to m2 do
for j := 1 to m2 do
begin
s2:= s2+ StrToFloat(StringGrid2.Cells[i,j]);
end;
Label1.Caption:=FloatToStr(s1+s2);
end;
procedure TForm1.BitBtn2Click(Sender: TObject);
var I,j: Integer;
begin
s1:=0; s2:=0;
for I := 1 to m1 do
for j := 1 to m1 do
begin
s1:= s1+ StrToFloat(StringGrid1.Cells[i,j]);
end;
for I := 1 to m2 do
for j := 1 to m2 do
begin
s2:= s2+ StrToFloat(StringGrid2.Cells[i,j]);
end;
Label1.Caption:=FloatToStr(s2-s1);
end;

procedure TForm1.BitBtn3Click(Sender: TObject);


var I,j: Integer;
begin
s1:=0; s2:=0;
for I := 1 to m1 do
for j := 1 to m1 do
begin
s1:= s1+ StrToFloat(StringGrid1.Cells[i,j]);
end;
for I := 1 to m2 do
for j := 1 to m2 do
begin
s2:= s2+ StrToFloat(StringGrid2.Cells[i,j]);
end;
Label1.Caption:=FloatToStr(s2*s1);
end;
procedure TForm1.BitBtn4Click(Sender: TObject);
var I,j: Integer;
begin
s1:=0; s2:=0;
for I := 1 to m1 do
for j := 1 to m1 do
begin
s1:= s1+ StrToFloat(StringGrid1.Cells[i,j]);
end;
for I := 1 to m2 do
for j := 1 to m2 do
begin
s2:= s2+ StrToFloat(StringGrid2.Cells[i,j]);
end;
Label1.Caption:=FloatToStr(s2/s1);
end;
procedure TForm1.BitBtn5Click(Sender: TObject);
var i,j,k,l:Integer;
begin
if (StrToInt(LabeledEdit1.Text)>0) and (StrToInt(LabeledEdit2.Text)>0) then
begin
m2:=StrToInt(LabeledEdit1.Text);
m1:=StrToInt(LabeledEdit2.Text);
StringGrid1.ColCount:=m1+1;
StringGrid1.RowCount:=m1+1;
StringGrid2.ColCount:=m2+1;
StringGrid2.RowCount:=m2+1;
for I := 0 to m1 do
begin
StringGrid1.Cells[i,0]:=IntToStr(i);
StringGrid1.Cells[0,i]:=IntToStr(i);
end;
for I := 0 to m2 do
begin
StringGrid2.Cells[i,0]:=IntToStr(i);
StringGrid2.Cells[0,i]:=IntToStr(i);
end;
end;
end;

Yüklə 349,5 Kb.

Dostları ilə paylaş:
1   ...   6   7   8   9   10   11   12   13   14




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©azkurs.org 2024
rəhbərliyinə müraciət

gir | qeydiyyatdan keç
    Ana səhifə


yükləyin