Advertisement
LOVEGUN

Tri_Bulle (Classique)

Feb 7th, 2021
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.34 KB | None | 0 0
  1. Type
  2.   tab = Array [1..10] Of Integer;
  3. Procedure tri_bul (Var t:tab;n:Integer);
  4. Var
  5.   i,aux: Integer;
  6.   echange: Boolean;
  7. Begin
  8.   Repeat
  9.         For i:=1 To n-1 Do
  10.         If t[i]>t[i+1] Then
  11.           Begin
  12.             aux := t[i];
  13.             t[i] := t[i+1];
  14.             t[i+1] := aux;
  15.           End;
  16.     n := n-1;
  17.   Until n=0;
  18. End;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement