Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
14
Task/Binary-digits/AWK/binary-digits.awk
Normal file
14
Task/Binary-digits/AWK/binary-digits.awk
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
BEGIN {
|
||||
print tobinary(0)
|
||||
print tobinary(1)
|
||||
print tobinary(5)
|
||||
print tobinary(50)
|
||||
print tobinary(9000)
|
||||
}
|
||||
|
||||
function tobinary(num) {
|
||||
outstr = num % 2
|
||||
while (num = int(num / 2))
|
||||
outstr = (num % 2) outstr
|
||||
return outstr
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue