Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,26 @@
|
|||
' Least common multiple
|
||||
PROGRAM "leastcommonmultiple"
|
||||
VERSION "0.0001"
|
||||
|
||||
DECLARE FUNCTION Entry()
|
||||
INTERNAL FUNCTION Gcd(m&, n&)
|
||||
INTERNAL FUNCTION Lcm(m&, n&)
|
||||
|
||||
FUNCTION Entry()
|
||||
PRINT "LCM(35, 21) ="; Lcm(35, 21)
|
||||
END FUNCTION
|
||||
|
||||
FUNCTION Gcd(m&, n&)
|
||||
DO WHILE m& <> 0
|
||||
tmp& = m&
|
||||
m& = n& MOD m&
|
||||
n& = tmp&
|
||||
LOOP
|
||||
RETURN n&
|
||||
END FUNCTION
|
||||
|
||||
FUNCTION Lcm(m&, n&)
|
||||
RETURN m& / Gcd(m&, n&) * n&
|
||||
END FUNCTION
|
||||
|
||||
END PROGRAM
|
||||
Loading…
Add table
Add a link
Reference in a new issue