DataMuseum.dk

Presents historical artifacts from the history of:

RegneCentralen RC700 "Piccolo"

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about RegneCentralen RC700 "Piccolo"

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦2c4bf869e⟧ TextFile

    Length: 512 (0x200)
    Types: TextFile
    Names: »BUBBLE3.PAS«

Derivation

└─⟦2a24d2e1b⟧ Bits:30003042 Programmer fra Aarhus kursus
    └─ ⟦this⟧ »BUBBLE3.PAS« 

TextFile

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»