Ver Mensaje Individual
  #54  
Antiguo 26-08-2008
tsue tsue is offline
Registrado
 
Registrado: ago 2008
Posts: 8
Reputación: 0
tsue Va por buen camino
muchas gracias por toda la ayuda que me hab brindado, logre terminar el programa desde el domingo pero como era para el lunes no iba a postearlo asta que pasara la entrega de tarea ya que alguien podia piratearlo y luego tendria problemas con el profe bueno este es el codigo que hice me base mucho en el codigo de caral y en el lenguaje ensamblador
Código Delphi [-]
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    Edit3: TEdit;
    Button1: TButton;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Label5: TLabel;
    Label6: TLabel;
    Label7: TLabel;
    Edit4: TEdit;
    Edit5: TEdit;
    Edit6: TEdit;
    Label8: TLabel;
    Label9: TLabel;
    Label10: TLabel;
    Button2: TButton;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var numinicial, numfinal, numactual, cantidad, total: integer;
begin
   numactual := 0;
   cantidad := 0;
   numinicial := 10;
   numfinal := 50;
   while numinicial <= numfinal do
   begin
   Inc(numactual, numinicial);
   Inc(numinicial);
   Inc(cantidad);
   end;
   total:= numactual div cantidad;
   Edit3.Text:= IntToStr(Total);
end;

procedure TForm1.Button2Click(Sender: TObject);
var numinicial, numfinal, numactual, cantidad, total: integer;
begin
   numactual := 0;
   cantidad := 0;
   numinicial := strToint(Edit4.Text);
   numfinal := strToint(Edit5.Text);
   while numinicial <= numfinal do
   begin
   Inc(numactual, numinicial);
   Inc(numinicial);
   Inc(cantidad);
   end;
   total:= numactual div cantidad;
   Edit6.Text:= IntToStr(Total);
end;

end.
Responder Con Cita