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

⟦fd7b94cd3⟧ TextFile

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

Derivation

└─⟦09235ab48⟧ Bits:30003065 Demoprogrammer K-Z til Pascal bog
    └─ ⟦this⟧ »TALFOELG.PAS« 

TextFile

PROGRAM talfoelg;

  VAR
    a, taeller : INTEGER;
  
  BEGIN
    WRITE(CLRHOM);
    WRITE('Indtast a: ');
    READLN(a);
    taeller := 1;
    WRITE(a : 5);
    WHILE a <> 1 DO
      BEGIN
        taeller := taeller + 1;
        IF ODD(a)
          THEN a := 3 * a + 1
          ELSE a := a DIV 2;
        WRITE(a : 5);
      END;
    WRITELN;
    WRITELN('Følgen har længden ', taeller -1);
  END.
«eof»