Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub easy()
- Dim t As Integer, s As Integer, n As Integer, i As Integer
- s = 0
- n = InputBox("Введите n")
- If (n = 0) Then MsgBox ("Неверно введено n"): End
- Call fact(n)
- End Sub
- Sub fact(n)
- For i = 1 To n
- t = 1 / i
- s = s + t
- Next i
- MsgBox "Сумма первых " & n & " членов ряда равна " & s
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment