Data update
This commit is contained in:
parent
35bcdeebf8
commit
74c69a0df6
2427 changed files with 31826 additions and 3468 deletions
18
Task/Casting-out-nines/PureBasic/casting-out-nines.basic
Normal file
18
Task/Casting-out-nines/PureBasic/casting-out-nines.basic
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
OpenConsole()
|
||||
Define.i base, c1, c2, k
|
||||
|
||||
base = 10
|
||||
c1 = 0
|
||||
c2 = 0
|
||||
For k = 1 To Pow(base, 2) - 1
|
||||
c1 + 1
|
||||
If k % (base - 1) = (k * k) % (base - 1)
|
||||
c2 + 1
|
||||
Print(Str(k) + " ")
|
||||
EndIf
|
||||
Next k
|
||||
|
||||
PrintN(#CRLF$ + "Trying " + Str(c2) + " numbers instead of " + Str(c1) + " numbers saves " + Str(100 - (100 * c2 / c1)) + "%")
|
||||
|
||||
PrintN(#CRLF$ + "Press ENTER to exit"): Input()
|
||||
CloseConsole()
|
||||
Loading…
Add table
Add a link
Reference in a new issue