实验五,用vb怎么编程
3个回答
展开全部
先获取用户的第一个数值,赋给n,然后套用题目的计算公式for循环n次,得出结果,再输出,完毕。
追问
不懂,能不能打编程啊
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
dim i as integer
dim j as integer
dim s as single
dim s1 as single
dim n as integer
s=0
for i =1 to n
s1=1
for j=1 to i
s1=s1*j
next j
if i mod 2 =0 then
s=s-1/s1
else
s=s+1/s1
endif
next i
s=format(s,".000000")
dim j as integer
dim s as single
dim s1 as single
dim n as integer
s=0
for i =1 to n
s1=1
for j=1 to i
s1=s1*j
next j
if i mod 2 =0 then
s=s-1/s1
else
s=s+1/s1
endif
next i
s=format(s,".000000")
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询