|
DataMuseum.dkPresents historical artifacts from the history of: CP/M |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about CP/M Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - download
Length: 512 (0x200) Types: TextFile Names: »BUBBLE3.PAS«
└─⟦2a24d2e1b⟧ Bits:30003042 Programmer fra Aarhus kursus └─ ⟦this⟧ »BUBBLE3.PAS«
program bubblesort; var i,j,lngd : integer; change : boolean; s : string(.255.); procedure byt(a,b :integer); var ch : char; begin write(s(.a.):3,s(.b.):3,' '); ch:=s(.a.); s(.a.):=s(.b.); s(.b.):=ch; change:=true; writeln(s); end; begin readln(s); j:=0; lngd:=len(s); repeat change:=false; j:=j+1; for i:=lngd -1 downto j do if s(.i.)>s(.i+1.) then byt(i,i+1); until not change; writeln(s); end.«eof»