用vb计算s=1+2\3+3\5+4\7+.,当第i项的值小于10^-5时结束
问题描述:
用vb计算s=1+2\3+3\5+4\7+.,当第i项的值小于10^-5时结束
答
Dim s As IntegerDim x As IntegerDim y As Integers = 0x = 1y = 1While (x \ y > 10 ^ -5)s = s + x \ yx = x + 1y = y + 2Wend-----------------------------------------------------------------------最后结果...