Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- *> Challenge from emahar
- *> https://www.youtube.com/watch?v=F8n5_vjfjJc
- program-id. emahar-challenge.
- data division.
- working-storage section.
- 77 i pic 99.
- 77 j pic 99.
- 77 numlen pic 9.
- 77 num pic xx.
- 77 result pic x(80).
- procedure division.
- proc-main.
- perform varying i from 1 by 1 until i is greater than 10
- initialize result
- perform varying j from 1 by 1 until j is greater than i
- initialize numlen
- inspect j tallying numlen for leading zeros
- move j (numlen + 1 : ) to num
- string result delimited by space
- num delimited by space
- into result
- end-perform
- display result
- end-perform
- stop run.
- end program emahar-challenge.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement