Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
18
Task/Casting-out-nines/FutureBasic/casting-out-nines.basic
Normal file
18
Task/Casting-out-nines/FutureBasic/casting-out-nines.basic
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
_base10 = 10
|
||||
|
||||
void local fn CastingOutNines
|
||||
NSUInteger i, c1 = 0, c2 = 0
|
||||
float percent
|
||||
|
||||
for i = 1 to _base10^2
|
||||
c1++
|
||||
if ( i mod ( _base10 -1 ) == ( i * i ) mod ( _base10 - 1 ) ) then c2++ : printf @"%d \b", i
|
||||
next
|
||||
print
|
||||
percent = 100 -( 100 * c2 / c1 )
|
||||
printf @"Trying %d numbers instead of %d numbers saves %.2f%%", c2, c1, percent
|
||||
end fn
|
||||
|
||||
fn CastingOutNines
|
||||
|
||||
HandleEvents
|
||||
Loading…
Add table
Add a link
Reference in a new issue