|
DataMuseum.dkPresents historical artifacts from the history of: CP/M |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about CP/M Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - download
Length: 896 (0x380) Types: TextFile Names: »PRIMFORD.PAS«
└─⟦08ea08c61⟧ Bits:30003924 PolyPascal programmer └─ ⟦this⟧ »PRIMFORD.PAS« └─⟦09235ab48⟧ Bits:30003065 Demoprogrammer K-Z til Pascal bog └─ ⟦this⟧ »PRIMFORD.PAS« └─⟦092727b26⟧ Bits:30005927 Demoprogrammer til Pascal bog (Jet-80) └─ ⟦this⟧ »PRIMFORD.PAS« └─⟦f983c2ef3⟧ Bits:30004681 Pascal opgaver (Butler) └─ ⟦this⟧ »PRIMFORD.PAS«
PROGRAM primford; VAR i, antal : INTEGER; FUNCTION prim(n : INTEGER) : BOOLEAN; VAR i : INTEGER; primtal : BOOLEAN; BEGIN primtal := TRUE; i := 1; WHILE (i < ROUND(SQRT(n))) AND primtal DO BEGIN i := i + 1; IF n MOD i = 0 THEN primtal := FALSE; END; prim := primtal; IF n = 1 THEN prim := FALSE; END; BEGIN WRITE(CLRHOM); WRITE('Tast antal: '); READLN(antal); FOR i := 1 TO antal DO BEGIN IF i MOD 50 = 1 THEN BEGIN WRITELN; WRITE(i : 4, ' '); END; IF prim(i) THEN WRITE('P') ELSE WRITE('.'); IF i MOD 10 = 0 THEN WRITE(' '); END; WRITELN; END. «eof»