) )
. 5.
( ), . , , , .
Do Loop , Exit Do.
. c - e > 0; x , .
1. , 2. , 3. ,
4. , 5. , 6. ,
7. , 8. , 9. ,
10. , 11. , 12. ,
13. , 14. , 15. ,
16. , 17. , 18. ,
19. , 20. , 21. ,
22. , 23. , 24. ,
25. .
.
.
, , . , . , , .
, n . , , .
. , : .
,
,
.
x , y .
, () ( x2).
. 3 : Command1 ( ), Text1 ( x) Label1 ( y).
Private Sub Command1_Click()
Const eps = 0.0001 '
Dim x As Double '
Dim y As Double '
Dim r As Double '
Dim x2 As Double ' (x )
Dim n As Integer '
x = CDbl(Text1.Text)
y = x: r = x: x2 = x ^ 2: n = 2
Do
r = r * x2 / ((2 * n + 1) * (2 * n))
y = y + r
n = n + 1
Loop Until Abs(r) < eps
Label1.Caption = CStr(y)
End Sub
1. c - .
2. .
3. .
4. .
5. Do While Do Until.
|
|