Data update
This commit is contained in:
parent
5150844a7d
commit
4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions
|
|
@ -1,26 +0,0 @@
|
|||
IDENTIFICATION DIVISION.
|
||||
PROGRAM-ID. SAMPLE.
|
||||
|
||||
DATA DIVISION.
|
||||
WORKING-STORAGE SECTION.
|
||||
|
||||
01 binary_number pic X(21).
|
||||
01 str pic X(21).
|
||||
01 binary_digit pic X.
|
||||
01 digit pic 9.
|
||||
01 n pic 9(7).
|
||||
01 nstr pic X(7).
|
||||
|
||||
PROCEDURE DIVISION.
|
||||
accept nstr
|
||||
move nstr to n
|
||||
perform until n equal 0
|
||||
divide n by 2 giving n remainder digit
|
||||
move digit to binary_digit
|
||||
string binary_digit DELIMITED BY SIZE
|
||||
binary_number DELIMITED BY SPACE
|
||||
into str
|
||||
move str to binary_number
|
||||
end-perform.
|
||||
display binary_number
|
||||
stop run.
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
IDENTIFICATION DIVISION.
|
||||
PROGRAM-ID. binary-conversion.
|
||||
|
||||
DATA DIVISION.
|
||||
WORKING-STORAGE SECTION.
|
||||
01 binary-number pic X(21).
|
||||
01 digit pic 9.
|
||||
01 n pic 9(7).
|
||||
01 nstr pic X(7).
|
||||
01 ptr pic 99.
|
||||
|
||||
PROCEDURE DIVISION.
|
||||
display "Number: " with no advancing.
|
||||
accept nstr.
|
||||
move nstr to n.
|
||||
move zeroes to binary-number.
|
||||
move length binary-number to ptr.
|
||||
perform until n equal 0
|
||||
divide n by 2 giving n remainder digit
|
||||
move digit to binary-number(ptr:1)
|
||||
subtract 1 from ptr
|
||||
if ptr < 1
|
||||
exit perform
|
||||
end-if
|
||||
end-perform.
|
||||
display binary-number.
|
||||
stop run.
|
||||
Loading…
Add table
Add a link
Reference in a new issue