procedure TForm1.FormCreate(Sender: TObject);
var
s: string;
begin
s:= #13#10;
with StringGrid1 do
begin
ColCount:= 4;
RowCount:= 9;
Rows[0].Text:= Concat('ФИО' ,s,'Название',s,'Кол-во',s,'Всего:');
Rows[1].Text:= Concat('Иванов И.П.' ,s,'Стул' ,s,'6' );
Rows[2].Text:= Concat('Казнулевич Н.Д.' ,s,'Стол' ,s,'2' );
Rows[3].Text:= Concat('Гаскаркян И.Л.' ,s,'Патефон' ,s,'1' );
Rows[4].Text:= Concat('Самарин В.Ю.' ,s,'Гардероб',s,'3' );
Rows[5].Text:= Concat('Карменко И.Ф.' ,s,'Табурет' ,s,'12' );
Rows[6].Text:= Concat('Лазюлькина.В.В.' ,s,'Диван' ,s,'7' );
Rows[7].Text:= Concat('Пышечкина К.К.' ,s,'Этажерка',s,'1' );
Rows[8].Text:= Concat('Задунайский О.Б.',s,'Стол' ,s,'8' );
end;
with StringGrid2 do
begin
ColCount:= 2;
RowCount:= 9;
Rows[0].Text:= 'Название'+s+'Цена';
Rows[1].Text:= 'Стул' +s+'3200';
Rows[2].Text:= 'Стол' +s+'7500';
Rows[3].Text:= 'Патефон' +s+'100000';
Rows[4].Text:= 'Гардероб'+s+'22800';
Rows[5].Text:= 'Табурет' +s+'2250';
Rows[6].Text:= 'Диван' +s+'70357';
Rows[7].Text:= 'Этажерка'+s+'1000';
Rows[8].Text:= 'Тумбочка'+s+'8735';
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
i,j: integer;
begin
for i := 1 to StringGrid1.RowCount-1 do
for j := 1 to StringGrid2.RowCount-1 do
if StringGrid1.Cells[1, i] = StringGrid2.Cells[0,j] then
begin
StringGrid1.Cells[3, i]:=
FloatToStr(StrToFloat(StringGrid1.Cells[2,i]) *
StrToFloat(StringGrid2.Cells[1,j]));
break;
end;
end;