tasks a-s
This commit is contained in:
parent
47bf37c096
commit
b83f433714
12433 changed files with 156208 additions and 123 deletions
17
Task/Binary-digits/XPL0/binary-digits.xpl0
Normal file
17
Task/Binary-digits/XPL0/binary-digits.xpl0
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
include c:\cxpl\codes; \intrinsic code declarations
|
||||
|
||||
proc BinOut(N); \Output N in binary
|
||||
int N;
|
||||
int R;
|
||||
[R:= N&1;
|
||||
N:= N>>1;
|
||||
if N then BinOut(N);
|
||||
ChOut(0, R+^0);
|
||||
];
|
||||
|
||||
int I;
|
||||
[I:= 0;
|
||||
repeat BinOut(I); CrLf(0);
|
||||
I:= I+1;
|
||||
until KeyHit or I=0;
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue