Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
25
Task/Babbage-problem/BBC-BASIC/babbage-problem-2.basic
Normal file
25
Task/Babbage-problem/BBC-BASIC/babbage-problem-2.basic
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
REM Lines that begin 'REM' are explanatory remarks addressed to the human reader.
|
||||
|
||||
REM The machine will ignore them.
|
||||
|
||||
LET n = 269696
|
||||
|
||||
REPEAT
|
||||
|
||||
LET n = n + 1000000
|
||||
|
||||
REM Find the next number that ends in 269,696.
|
||||
|
||||
REM The function SQR finds the square root.
|
||||
|
||||
LET root = SQR n
|
||||
|
||||
REM The function INT truncates a real number to an integer.
|
||||
|
||||
UNTIL root = INT root
|
||||
|
||||
REM If the square root is equal to its integer truncation, then it is an integer: so we have found our answer.
|
||||
|
||||
PRINT "The smallest number whose square ends in 269696 is" root
|
||||
|
||||
PRINT "Its square is" n
|
||||
Loading…
Add table
Add a link
Reference in a new issue