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

⟦07f2aa981⟧ TextFile

    Length: 768 (0x300)
    Types: TextFile
    Names: »BINOM4.PAS«

Derivation

└─⟦3702e543b⟧ Bits:30003064 Demoprogrammer A-J til Pascal bog
    └─ ⟦this⟧ »BINOM4.PAS« 

TextFile

PROGRAM binom4;

  VAR
    n, r, graense : INTEGER;
  
  FUNCTION k(n, r : INTEGER) : INTEGER;
  
    TYPE
      tabel = ARRAY(.0 .. 20, 0 .. 20.) OF INTEGER;
    
    VAR
      tab : tabel;
      i, j : INTEGER;
    
    BEGIN
      FOR i := 1 TO n DO
        FOR j := 0 TO i DO
          IF (j = 0) OR (i = j)
            THEN tab(.i, j.) := 1
            ELSE tab(.i, j.) := tab(.i - 1, j.) + tab(.i - 1, j - 1.);
      k := tab(.n, r.);
    END;
  
  BEGIN
    WRITE(CLRHOM);
    WRITE('Tast antal linier: '); READLN(graense);
    FOR n := 1 TO graense DO
      BEGIN
        FOR r := 0 TO n DO
          WRITE(k(n,r) : 4);
        WRITELN;
      END;
  END.
«eof»