如下程序,运行后各变量的值依次为____

[复制链接]
查看11 | 回复1 | 2011-6-18 00:32:56 | 显示全部楼层 |阅读模式
Public Sub proc(byref a%())
static i%
do
a(i)=a(i)+a(i+1)
i=i+1
loop while i<2
end sub
sub Button1_Click(...) Handles button1.click
dim m%,i%,x%(10)
for i=0 to 4: x(i)=i+1: next i
for i=1 to 2: call proc(x): next i
for i=0 to 4: msgbox(x(i)) : next i
end sub
A.34756B.35745
c.23445D.45678

回复

使用道具 举报

千问 | 2011-6-18 00:32:56 | 显示全部楼层
如果您的程序是这样:Public Sub proc(byref a%())static i%doa(i)=a(i)+a(i+1)i=i+1loop while i<2end subprivate sub Button1_Click() dim m%,i%,x%(10)for i=0 to 4: x(i)=i+1: next ifor i=1 to 2: call proc(x): next ifor i=0 to 4: msgbox(x(i)) : next iend sub那第一次单击就得到:35745...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行