Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
15
Task/Executable-library/REXX/executable-library-3.rexx
Normal file
15
Task/Executable-library/REXX/executable-library-3.rexx
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
/*REXX pgm finds the most common (popular) hailstone sequence length. */
|
||||
parse arg z .; if z=='' then z=99999 /*get the optional first argument*/
|
||||
!.=0
|
||||
w=0; do j=1 for z /*═════════════task 4════════════*/
|
||||
#=words(hailstone(j)) /*obtain hailstone sequence count*/
|
||||
!.# = !.# + 1 /*add unity to popularity count. */
|
||||
end /*j*/
|
||||
occ=0; p=0
|
||||
do k=1 for z
|
||||
if !.k>occ then do; occ=!.k; p=k; end
|
||||
end /*p*/
|
||||
|
||||
say '(between 1──►'z") " p,
|
||||
' is the most common hailstone sequence length (with' occ "occurrences)."
|
||||
/*stick a fork in it, we're done.*/
|
||||
Loading…
Add table
Add a link
Reference in a new issue