DataMuseum.dk

Presents historical artifacts from the history of:

CP/M

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

See our Wiki for more about CP/M

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦0facfa1bf⟧ TextFile

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

Derivation

└─⟦08ea08c61⟧ Bits:30003924 PolyPascal programmer
    └─ ⟦this⟧ »BINOM3.PAS« 
└─⟦092727b26⟧ Bits:30005927 Demoprogrammer til Pascal bog (Jet-80)
    └─ ⟦this⟧ »BINOM3.PAS« 
└─⟦3702e543b⟧ Bits:30003064 Demoprogrammer A-J til Pascal bog
    └─ ⟦this⟧ »BINOM3.PAS« 
└─⟦f983c2ef3⟧ Bits:30004681 Pascal opgaver (Butler)
    └─ ⟦this⟧ »BINOM3.PAS« 

TextFile

PROGRAM binom3;

  VAR
    n, r, graense : INTEGER;
  
  FUNCTION k(n, r : INTEGER) : INTEGER;
  
    BEGIN
      IF (n = r) OR (r = 0)
        THEN k := 1
        ELSE k := k(n - 1, r) + k(n - 1, r - 1);
    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»