计算VB程序段,要写过程

来源:百度知道 编辑:UC知道 时间:2024/05/22 14:59:35
9以下VB程序段的运行结果是:()
a=1
b=2
t=a
b=t
Print a,b,t
10以下VB程序段的运行结果是()
a=1
b=2
if a>b then
c=a
else
c=b
end凵if
Print a,b,c

9以下VB程序段的运行结果是:()
a=1-------------------------a=1
b=2------------------------b=2
t=a-------------------------t=1
b=t--------------------------b=1
Print a,b,t-------------------1 1 1
10以下VB程序段的运行结果是()
a=1-----------------------------a=1
b=2-----------------------------b=2
if a>b then------------------a>b不成立
c=a
else--------------------------成立
c=b---------------------------c=2
end凵if
Print a,b,c ------------------1 2 2

a=1,t=a,则t=1;b=2,t=1,重新定义b=t,则b=1.
顺次(a,b,t)为 (1,1,1)

=========================================
a=1,b=2,而a≯b,所以c≠a,因此,c=b,即c=2.
顺次(a,b,c)为 (1,2,2)

1 1 1
1 2 2

1 1 1
1 2 2