Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ada 0.35 KB | None | 0 0
  1. -- Imaginamos que existe un array llamada lista[10] con números desordenados
  2.  
  3. for i in lista'range loop
  4.     for j in i..lista'last-1
  5.         if lista(j) > lista(j+1) then
  6.             aux = lista(j);
  7.             lista(j) = lista(j+1);
  8.             lista(j+1) = aux;
  9.         end if;
  10.     end loop;
  11. end loop;
  12.  
  13. --Básicamente, lo que hace es esto:
  14. --https://www.youtube.com/watch?v=EQMGabLO_M0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement