Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
17
Task/Binary-digits/Oberon-2/binary-digits.oberon
Normal file
17
Task/Binary-digits/Oberon-2/binary-digits.oberon
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
MODULE BinaryDigits;
|
||||
IMPORT Out;
|
||||
|
||||
PROCEDURE OutBin(x: INTEGER);
|
||||
BEGIN
|
||||
IF x > 1 THEN OutBin(x DIV 2) END;
|
||||
Out.Int(x MOD 2, 1);
|
||||
END OutBin;
|
||||
|
||||
|
||||
BEGIN
|
||||
OutBin(0); Out.Ln;
|
||||
OutBin(1); Out.Ln;
|
||||
OutBin(2); Out.Ln;
|
||||
OutBin(3); Out.Ln;
|
||||
OutBin(42); Out.Ln;
|
||||
END BinaryDigits.
|
||||
Loading…
Add table
Add a link
Reference in a new issue