1. 读程序。写出程序运行结果
(1) x=5
y=x+1
y=10
x=y+2
print x,y
__________________________________
(2) x=5
y=10
y=x+1
x=y+2
print “x=”;x
print “y=”;y
_____________________________
_____________________________
(3) a=5:b=7
if a>=b then
max=a
else
max=b
endif
print max
______________________________
(4) x=1
y=2
if x>=y then
print x,y
else
print y,x
endif
______________________
1. 编写计算1+1/2+1/3+1/4+……+1/100的程序,请填空补充完善程序。
Private sub form_click( )
S=0
For i____ to _____step
S= _______
Next i
Print “s=”,s
交换两个数:
Private sub form_click( )
X=inputbox(“第一个数 “:” ,“输入”)
Y= inputbox(“第一个数 “:” ,“输入”)
_________________________________
_________________________________
_________________________________
Print “交换后” ;
Print “第一个数为;” ;x “第二个数为;”y (这里看不清楚,不知道是不是这样)
2. 写出下列程序运行结果
For i = 1 to 9 step 4
Print i
Next i
S = 1
For i = 10 to 4 step -3
S = s*1
Print i , s
Next i