Perdón, este es todo mi código; esta construido en el programa Lazarus
Código Delphi
[-]unit Unit1;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
Buttons;
type
TForm1 = class(TForm)
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
BitBtn3: TBitBtn;
Edit1: TEdit;
Edit2: TEdit;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
procedure BitBtn1Click(Sender: TObject);
procedure BitBtn2Click(Sender: TObject);
procedure BitBtn3Click(Sender: TObject);
private
public
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
Procedure cantidad_de_divisores(n:Integer);
var
vNumero, vI, vCantidad: Integer;
begin
vCantidad := 0;
vNumero := StrToInt(Edit1.Text);
for vI := 1 to vNumero do
if (vNumero mod vI) = 0 then
vCantidad := vCantidad + 1;
Result := vCantidad;
end;
procedure TForm1.BitBtn1Click(Sender: TObject);
var
n:Integer;
codigo:Integer;
begin
val(Edit1.Text,n,codigo);
cantidad_de_divisores(n);
end;
procedure TForm1.BitBtn2Click(Sender: TObject);
begin
Edit1.Clear;Edit2.Clear;
end;
procedure TForm1.BitBtn3Click(Sender: TObject);
begin
Close;
end;
end.