marcus2vinicius

Funcao Inverte Nome PASCAL

Aug 22nd, 2011
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.44 KB | None | 0 0
  1. Program FuncaoInverteNome;
  2.   function invert(nome:string): string;
  3.     var
  4.      i,tamanho: integer;
  5.      novo: string;
  6.     Begin
  7.       novo:='';
  8.      tamanho  := length(nome);
  9.      for i  := tamanho downto 1 do
  10.        novo :=  novo + nome[i];
  11.     invert  := novo;
  12.      
  13.     end;  
  14. var
  15.  nome: string;
  16.  Begin
  17.   Write('Informe Nome: ');
  18.   readln(nome);
  19.    Write(invert(nome));
  20.    
  21.  Writeln('                   by Marcus Vinicius');
  22.  End.
Advertisement
Add Comment
Please, Sign In to add comment