Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
30
Task/Gapful-numbers/PureBasic/gapful-numbers.basic
Normal file
30
Task/Gapful-numbers/PureBasic/gapful-numbers.basic
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
Procedure.b isGapNum(n.i)
|
||||
n1.i=n%10
|
||||
n2.i=Val(Left(Str(n),1))
|
||||
If n%(n2*10+n1)=0
|
||||
ProcedureReturn #True
|
||||
Else
|
||||
ProcedureReturn #False
|
||||
EndIf
|
||||
EndProcedure
|
||||
|
||||
Procedure PutGapNum(start.i,rep.i,lfi.i=10)
|
||||
n.i=start
|
||||
While rep
|
||||
If isGapNum(n)
|
||||
Print(Str(n)+" ")
|
||||
rep-1
|
||||
If rep%lfi=0 : PrintN("") : EndIf
|
||||
EndIf
|
||||
n+1
|
||||
Wend
|
||||
EndProcedure
|
||||
|
||||
OpenConsole()
|
||||
PrintN("First 30 gapful numbers ≥ 100:")
|
||||
PutGapNum(100,30)
|
||||
PrintN(~"\nFirst 15 gapful numbers ≥ 1,000,000:")
|
||||
PutGapNum(1000000,15,5)
|
||||
PrintN(~"\nFirst 10 gapful numbers ≥ 1,000,000,000:")
|
||||
PutGapNum(1000000000,10,5)
|
||||
Input()
|
||||
Loading…
Add table
Add a link
Reference in a new issue