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

⟦3bc5122b2⟧ TextFile

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

Derivation

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

TextFile

program bubblesort;
var  i,j : 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:=len(s);
  repeat
    change:=false;
    j:=j-1;
    for i:=1 to j do
      if s(.i.)<s(.i+1.) then
        byt(i,i+1);
 until not change;
 writeln(s);
end.«eof»