Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
27
Task/Harmonic-series/FutureBasic/harmonic-series.basic
Normal file
27
Task/Harmonic-series/FutureBasic/harmonic-series.basic
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
include "NSLog.incl"
|
||||
|
||||
void local fn BuildHamonics
|
||||
double h = 0.0
|
||||
long i, n
|
||||
|
||||
NSLog( @"The first twenty harmonic numbers are:\n" )
|
||||
for i = 1 to 20
|
||||
h = h + 1.0 / i
|
||||
NSLog( @"%3d. %.8f", i, h )
|
||||
next
|
||||
|
||||
NSLog( @"\n" )
|
||||
|
||||
h = 1 : n = 2
|
||||
for i = 2 to 10
|
||||
while h < i
|
||||
h = h + 1.0 / n
|
||||
n = n + 1
|
||||
wend
|
||||
NSLog( @"The first harmonic number > %2d is %11.8f at position %d.", i, h, n -1 )
|
||||
next
|
||||
end fn
|
||||
|
||||
fn BuildHamonics
|
||||
|
||||
HandleEvents
|
||||
Loading…
Add table
Add a link
Reference in a new issue