|
|
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 - metrics - download
Length: 2944 (0xb80)
Types: TextFile
Names: »GRUNDTAL.PAS«
└─⟦f983c2ef3⟧ Bits:30004681 Pascal opgaver (Butler)
└─⟦this⟧ »GRUNDTAL.PAS«
:= 2;
WRITE('Fra hvilket talsystem (2 - ', max, '): ');
READLN(fragrundtal);
VAL(fragrundtal, frag, test);
UNTIL test = 0;
UNTIL (2 <= frag) AND (frag <= max);
GOTOXY(5, 3);
WRITE('Cifrene i ', frag, '-talsystemet: ');
FOR i := 1 TO frag DO
WRITE(cifre(.i.), ' ');
REPEAT
GOTOXY(5, 7);
WRITE(CLREOL);
BUFLEN := 30;
ok := TRUE;
WRITE('Hvilket tal skal omformes: ');
READLN(fratal);
FOR i := 1 TO LEN(fratal) DO
IF POS(fratal(.i.), COPY(cifre, 1, frag)) = 0
THEN ok := FALSE;
UNTIL ok AND (LEN(fratal) > 0);
REPEAT
REPEAT
GOTOXY(5, 11);
WRITE(CLREOL);
BUFLEN := 2;
WRITE('Til hvilket talsystem (2 - ', max, '): ');
READLN(tilgrundtal);
VAL(tilgrundtal, tilg, test);
UNTIL test = 0;
UNTIL (2 <= tilg) AND (tilg <= max);
GOTOXY(5, 13);
WRITE('Cifrene i ', tilg, '-talsystemet: ');
FOR i := 1 TO tilg DO
WRITE(cifre(.i.), ' ');
GOTOXY(5, 17);
WRITE(frag, '-talsystemet: ', fratal);
GOTOXY(5, 19);
WRITE(tilg, '-talsystemet: ');
til10(frag, fratal, tal10);
fra10(tilg, tal10, tiltal);
WRITELN(tiltal);
WRITELN;
END. (* grundtal *)
«eof»