作业帮 > 综合 > 作业

请问sqr(1+sqr(2+sqr(3+sqr(4+sqr(5+sqr(6+.

来源:学生作业帮 编辑:大师作文网作业帮 分类:综合作业 时间:2024/11/17 13:16:40
请问sqr(1+sqr(2+sqr(3+sqr(4+sqr(5+sqr(6+.
sqr(1+sqr(2+sqr(3+sqr(4+sqr(5+sqr(6+.
一直到n...如何在vb实现.....
请问sqr(1+sqr(2+sqr(3+sqr(4+sqr(5+sqr(6+.
楼上那个是错的,代入N=2直接就看到是错的了!
Private Function xxx(ByVal n As Long) As Double
Dim tmp As Double,i As Long
tmp = n
Do While n > 1
tmp = Sqr(tmp) + (n - 1)
n = n - 1
Loop
xxx = Sqr(tmp)
End Function
没有处理N=1的情况,你处理一下就行了.