procedure TPermutasi.Button1Click(Sender: TObject);
var a,b,i,n,r,z,j:Integer;
t:Real;
begin
a:=StrToInt(Edit1.Text);
b:=StrToInt(Edit2.Text);
n:=1;
r:=1;
j:=a-b;
For i:=1 to a do
n:=i*n;
Begin
For i:=1 to j do
r:=i*r;
End;
t:=n/r;
Edit3.Text:=FloatToStr(t);
if a<b then Edit3.Text:='Error';
if a=b then edit3.Text:=inttostr(n);
if (a<0) or (b<0) then edit3.text:='Error';
end;
procedure TPermutasi.Button2Click(Sender: TObject);
begin
edit1.Text:=' ';
edit2.Text:=' ';
edit3.Text:=' ';
end;
procedure TPermutasi.Timer1Timer(Sender: TObject);
begin
label5.Left:=label5.Left-30;
if label5.Left<=0 then
label5.Left := 150;
end;
procedure TPermutasi.Button3Click(Sender: TObject);
begin
AplikasiBilanganBulat.Show;
Permutasi.Hide;
end;
end.
Minggu, 30 Oktober 2016
Langganan:
Posting Komentar (Atom)
0 komentar:
Posting Komentar