Data update
This commit is contained in:
parent
81fd053722
commit
52a6ef48dd
10248 changed files with 63654 additions and 6775 deletions
17
Task/Harmonic-series/PascalABC.NET/harmonic-series.pas
Normal file
17
Task/Harmonic-series/PascalABC.NET/harmonic-series.pas
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
function H(n: integer): real := (1..n).Sum(i -> 1/i);
|
||||
|
||||
begin
|
||||
for var i:=1 to 20 do
|
||||
Println($'{i,2}: {H(i),10:f8}');
|
||||
var i := 1;
|
||||
var num := 1;
|
||||
while num < 11 do
|
||||
begin
|
||||
if H(i) > num then
|
||||
begin
|
||||
Println('Position of the first harmonic number >',num,':',i);
|
||||
num += 1;
|
||||
end;
|
||||
i += 1;
|
||||
end;
|
||||
end.
|
||||
Loading…
Add table
Add a link
Reference in a new issue