Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Varios
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Coloboración Paypal con ClubDelphi

 
 
Herramientas Buscar en Tema Desplegado
  #6  
Antiguo 02-11-2017
Avatar de ElKurgan
[ElKurgan] ElKurgan is offline
Miembro Premium
 
Registrado: nov 2005
Posts: 1.243
Poder: 22
ElKurgan Va camino a la fama
Código Delphi [-]
function primeryúltimodígito(n:integer):integer;
var e,inv,d,a:integer;
begin
  inv:=0;
  e:=n;
while n>0 do
begin
   d:=n mod 10;
    inv:=inv*10+d;
    n:=n div 10;
end;
a:=e mod 10;
result:= (d * 10) + a; // Te falta esto
end;

procedure TForm2.N1PRIMERYLTIMODGITO1Click(Sender: TObject);
// Vamos a suponer que tienes un Edit1 donde se teclea el valor numérico
var i: Integer;
begin
  i := StrToInt(Edit1.Text);
  Edit2.Text := IntToSTr(primeryúltimodígito(i));
end;

end.

Espero haberte ayudado
Saludos
Responder Con Cita
 



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Función javascript que llama a otra función javascript en otra página jandroruiz HTML, Javascript y otros 4 28-02-2013 11:38:00
Funcion? borlandpablo C++ Builder 8 18-10-2012 12:27:14
Función o q? Veanny Internet 2 21-02-2008 21:43:40
La función Ord() soul6301 Varios 2 27-06-2004 01:43:17
funcion agora18 SQL 1 06-10-2003 07:18:30


La franja horaria es GMT +2. Ahora son las 21:51:40.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi