一的阶乘一直加到十的阶乘的vb程序用do while语句怎么编
4个回答
展开全部
Dim i, j As Integer
Dim jiecheng, Totaljiecheng As Long
i = 0
j = 0
jiecheng = 0
Totaljiecheng = 0
Do While (i < 10)
i = i + 1
jiecheng = 1
j = 0
Do While (j < i)
j = j + 1
jiecheng = jiecheng * j
Loop
Totaljiecheng = Totaljiecheng + jiecheng
Loop
MsgBox Totaljiecheng
Dim jiecheng, Totaljiecheng As Long
i = 0
j = 0
jiecheng = 0
Totaljiecheng = 0
Do While (i < 10)
i = i + 1
jiecheng = 1
j = 0
Do While (j < i)
j = j + 1
jiecheng = jiecheng * j
Loop
Totaljiecheng = Totaljiecheng + jiecheng
Loop
MsgBox Totaljiecheng
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
用手踢球1 你那是C了
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
dim value%=1;
dim i%=2;
do while(i<=10){
value=value*i;
i=i+1;
next i;
}
逻辑上大概这样,语法不太记得了,vb太过时了,学的意义不大,建议尝试c或者Java
dim i%=2;
do while(i<=10){
value=value*i;
i=i+1;
next i;
}
逻辑上大概这样,语法不太记得了,vb太过时了,学的意义不大,建议尝试c或者Java
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询