Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
21
Task/Babbage-problem/PureBasic/babbage-problem.basic
Normal file
21
Task/Babbage-problem/PureBasic/babbage-problem.basic
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
EnableExplicit
|
||||
Macro putresult(n)
|
||||
If OpenConsole("Babbage_problem")
|
||||
PrintN("The smallest number whose square ends in 269696 is " + Str(n))
|
||||
Input()
|
||||
EndIf
|
||||
EndMacro
|
||||
|
||||
CompilerIf #PB_Processor_x64
|
||||
#MAXINT = 1 << 63 - 1
|
||||
CompilerElseIf #PB_Processor_x86
|
||||
#MAXINT = 1 << 31 - 1
|
||||
CompilerEndIf
|
||||
|
||||
#GOAL = 269696
|
||||
#DIV = 1000000
|
||||
Define n.i, q.i = Int(Sqr(#MAXINT))
|
||||
|
||||
For n = 2 To q Step 2
|
||||
If (n*n) % #DIV = #GOAL : putresult(n) : Break : EndIf
|
||||
Next
|
||||
Loading…
Add table
Add a link
Reference in a new issue