P_4_3.PAS
上传用户:afrynkmhm
上传日期:2007-01-06
资源大小:1262k
文件大小:0k
- { program 4.3
- compute h(n) = 1 + 1/2 + 1/3 +...+ 1/n }
- program egrepeat(input, output);
- var
- n : integer;
- h : real;
- begin
- read(n);
- write(n);
- h := 0;
- repeat
- h := h + 1/n;
- n := n - 1;
- until n=0;
- writeln(h);
- end.