mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-28 07:56:36 +08:00
Completes coding of the PWM module
git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@4200 7fd9a85b-ad96-42d3-883c-3090e2eb8679
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
{ compute h(n) = 1 + 1/2 + 1/3 +...+ 1/n }
|
||||
|
||||
program egrepeat(input, output);
|
||||
|
||||
var
|
||||
n : integer;
|
||||
h : real;
|
||||
|
||||
begin
|
||||
read(n);
|
||||
writeln(n);
|
||||
h := 0;
|
||||
repeat
|
||||
h := h + 1/n;
|
||||
n := n - 1;
|
||||
until n=0;
|
||||
writeln(h);
|
||||
end.
|
||||
Reference in New Issue
Block a user