Ver Mensaje Individual
  #3  
Antiguo 08-02-2009
Avatar de droguerman
droguerman droguerman is offline
Miembro
 
Registrado: abr 2005
Ubicación: tierra
Posts: 999
Reputación: 20
droguerman Va por buen camino
podria ser algo asi (falta optimizar)
Código Delphi [-]
var
  texto : string;
  i : integer;
  suma : integer;
  resultado : integer;
 begin
  texto := IntToStr(numero);
  suma := 0;
  for i:= 1 to length(texto) do
  begin
      suma := suma + StrToInt( texto[i] ) * (1+(i mod 2));
  end;
 resultado := 30-suma;
end;
__________________
self.free;

Última edición por droguerman fecha: 08-02-2009 a las 02:51:30.
Responder Con Cita