Амин Дилеков
S:19:30:36 23.05
R:19:30:37 23.05
unit Unit1;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, Grids, StdCtrls;
type
{ TForm1 }
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
StringGrid1: TStringGrid;
StringGrid2: TStringGrid;
StringGrid3: TStringGrid;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
public
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
{ TForm1 }
procedure TForm1.FormCreate(Sender: TObject);
var i: integer;
begin
StringGrid1.RowCount:= 7;
StringGrid1.ColCount:= 6;
StringGrid2.RowCount:= 6;
StringGrid2.ColCount:= 6;
StringGrid3.RowCount:= 7;
StringGrid3.ColCount:= 6;
for i:= 1 to StringGrid1.RowCount-1 do StringGrid1.Cells[0,i]:= IntToStr(i);
for i:= 1 to StringGrid1.ColCount-1 do StringGrid1.Cells[i,0]:= IntToStr(i);
for i:= 1 to StringGrid2.RowCount-1 do StringGrid2.Cells[0,i]:= IntToStr(i);
for i:= 1 to StringGrid2.ColCount-1 do StringGrid2.Cells[i,0]:= IntToStr(i);
for i:= 1 to StringGrid3.RowCount-1 do StringGrid3.Cells[0,i]:= IntToStr(i);
for i:= 1 to StringGrid3.ColCount-1 do StringGrid3.Cells[i,0]:= IntToStr(i);
Button1.Caption:= *Start*;
Button2.Caption:= *Clean*;
Label1.Caption:= *A*;
Label2.Caption:= *B*;
Label3.Caption:= *C =A x B*;
end;
procedure TForm1.Button1Click(Sender: TObject);
var a,i,j,s,k,e: integer;
chis: string;
begin
for i:= 1 to StringGrid1.RowCount-1 do
for j:= 1 to StringGrid1.ColCount-1 do begin
e:= 1;
while not (e = 0) do begin
chis:= InputBox(*Ðвод*,*ÐÐ»ÐµÐ¼ÐµÐ½Ñ *+IntToStr(i)+* , *+IntToStr(j),**);
val(chis,a,e);
if not(e = 0) then writeln(*ÐведиÑе Ñелое ÑиÑло*);
end;
StringGrid1.Cells[j,i]:= chis;
end;
for i:= 1 to StringGrid1.RowCount-1 do
for j:= 1 to StringGrid1.ColCount-1 do begin
e:= 1;
while not (e = 0) do begin
chis:= InputBox(*Ðвод*,*ÐÐ»ÐµÐ¼ÐµÐ½Ñ *+IntToStr(i)+* , *+IntToStr(j),**);
val(chis,a,e);
if not(e = 0) then writeln(*ÐведиÑе Ñелое ÑиÑло*);
end;
StringGrid1.Cells[j,i]:= chis;
end;
for i:= 1 to StringGrid2.RowCount-1 do
for j:= 1 to StringGrid2.ColCount-1 do StringGrid2.Cells[j,i]:= IntToStr(i);
for i:= 1 to StringGrid3.RowCount-1 do
for j:= 1 to StringGrid3.ColCount-1 do StringGrid3.Cells[j,i]:= IntToStr(i);
for i:= 1 to StringGrid1.RowCount-1 do
for j:= 1 to StringGrid2.ColCount-1 do begin
s:= 0;
for k:= 1 to StringGrid1.ColCount - 1 do begin
S:= S + StrToInt(StringGrid1.Cells[k,i])[club27552627|StringGrid2.Cells[j,k];
StringGrid3.Cells[j,i] := IntToStr(s);
end;
end;
end;