Ver Mensaje Individual
  #49  
Antiguo 25-08-2008
[maeyanes] maeyanes is offline
Capo de los Capos
 
Registrado: may 2003
Ubicación: Campeche, México
Posts: 2.732
Reputación: 24
maeyanes Va por buen camino
Corrigiendo un par de errores de Delphius:

Código Delphi [-]
function Promedio(Inicial, Final: integer): double;
var
  suma, Ini: integer;

begin
  suma := 0;
  Ini := inicial;
  while Ini <= final do
  begin
    suma := suma + Ini;
    inc(Ini)
  end;
  result := suma / (Final - Inicial + 1)
end;


Saludos...
Responder Con Cita