Euclids orchard by *yuko*(LF)

program-id.y.data division.working-storage section.
1 i pic 999.
1 j pic 999.
1 n pic 99.
1.
2 s pic x(999) occurs 999.procedure division.accept s(1)move s(1)to n
move"t"to s(1).a.add 1 to i
move 0 to j.b.add 1 to j
move s(i)(j:)to s(i)(i+j:)move s(i)(j:j)to s(i+j)(i:)if j<100 go b.display s(i)(1:n*10)if i<n*10 go a.

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page