NowComment
2-Pane Combined
Comments:
Full Summaries Sorted

matricasabmno

Sabiranje matrica (Delphi projekat)

https://zoricabegus.wordpress.com/informatika-iii-razred-pascal-delphi/

unit Matricasabmno;

interface

uses

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

Dialogs, StdCtrls, Grids, ExtCtrls;

type

TForm1 = class(TForm)

StringGrid1: TStringGrid;

StringGrid2: TStringGrid;

StringGrid3: TStringGrid;

Button1: TButton;

Label1: TLabel;

Edit1: TEdit;

RadioGroup1: TRadioGroup;

procedure Button1Click(Sender: TObject);

procedure RadioGroup1Click(Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

var

Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);

var i:integer;

begin

StringGrid1.ColCount:=StrToInt(edit1.Text)+1;

StringGrid1.RowCount:=StringGrid1.ColCount;

For i:= 0 to stringGrid1.ColCount-1 do StringGrid1.Cells[i,0]:=IntToStr(i);

For i:= 1 to stringGrid1.RowCount-1 do StringGrid1.Cells[0,i]:=IntToStr(i);

StringGrid1.Visible:=true;

StringGrid2.ColCount:=StrToInt(edit1.Text)+1;

StringGrid2.RowCount:=StringGrid2.ColCount;

For i:= 0 to stringGrid2.ColCount-1 do StringGrid2.Cells[i,0]:=IntToStr(i);

For i:= 1 to stringGrid2.RowCount-1 do StringGrid2.Cells[0,i]:=IntToStr(i);

StringGrid2.Visible:=true;

StringGrid3.ColCount:=StrToInt(edit1.Text)+1;

StringGrid3.RowCount:=StringGrid3.ColCount;

For i:= 0 to stringGrid3.ColCount-1 do StringGrid3.Cells[i,0]:=IntToStr(i);

For i:= 1 to stringGrid3.RowCount-1 do StringGrid3.Cells[0,i]:=IntToStr(i);

StringGrid3.Visible:=true;

end;

procedure TForm1.RadioGroup1Click(Sender: TObject);

var i,j,m:integer;

s:real;

begin

case radiogroup1.ItemIndex of

0:begin

for i:= 1 to stringGrid1.ColCount-1 do

for j:= 1 to stringGrid1.ColCount-1 do

StringGrid3.Cells[i,j]:=FloatToStr( StrTofloat(StringGrid1.Cells[i,j])+

StrTofloat(StringGrid2.Cells[i,j]));

end;

1:begin

for i:= 1 to stringGrid1.ColCount-1 do

for j:= 1 to stringGrid1.ColCount-1 do

StringGrid3.Cells[i,j]:=FloatToStr( StrTofloat(StringGrid1.Cells[i,j])-

StrTofloat(StringGrid2.Cells[i,j]));

end;

2:begin

for j:= 1 to stringGrid1.ColCount-1 do begin

for i:= 1 to stringGrid1.ColCount-1 do

begin

s:=0;

for m:= 1 to stringGrid1.ColCount-1 do begin

s:=s+ StrTofloat(StringGrid1.Cells[m,j])*

StrTofloat(StringGrid2.Cells[i,m]);

end;

StringGrid3.Cells[i,j]:=FloatToStr(s);

end;

end;

end;

end;

end;end.

DMU Timestamp: January 25, 2018 19:54





Image
0 comments, 0 areas
add area
add comment
change display
Video
add comment

Quickstart: Commenting and Sharing

How to Comment
  • Click icons on the left to see existing comments.
  • Desktop/Laptop: double-click any text, highlight a section of an image, or add a comment while a video is playing to start a new conversation.
    Tablet/Phone: single click then click on the "Start One" link (look right or below).
  • Click "Reply" on a comment to join the conversation.
How to Share Documents
  1. "Upload" a new document.
  2. "Invite" others to it.

Logging in, please wait... Blue_on_grey_spinner