VB 题目:编写函数fun其功能是:根据整型形参m,计算如下公式的值:y=1⼀2+1⼀4+1⼀6..+1⼀2m 程序代码帮忙下!

2024-11-22 13:29:18
推荐回答(1个)
回答1:

private sub fun(m as integer) as single
dim i as integer
for i=1 to m
fun=fun+1/(2*i)
next
end sub