VB考试,急得要死汗水狂流不想挂科

来源:百度知道 编辑:UC知道 时间:2024/05/15 19:15:11
x=0
for k=3 to 5
x=x+2
s=s+x
next k
pint s 运行的结果是。请给出怎么做的方法。我明天要考VB这个学期都没听过课程,在突击
private sub command1 click()
dim i as integer ,n as integer
for i=0 to 50
i=i+3
n=n+1
if i>10 then exit for
next
text1.text=str(n)
end sub 请告诉偶怎么写谢谢。过程一定要哦
谢谢您。您能让我加您QQ吗。我会给你200分的

第1题,循环从3到5,
第一次,X=0+2=2
s=0+2=2
第二次,X=4,s=2+4=6
第三次,x=6,s=6+6=12
因此打出12

第二题,循环从0到50,但是中间>10时退出循环,因此
第一次,i=0+3=3, n=0+1=1, next时i再+1=4
第二次,i=4+3=7,n=1+1=2,next时i再+1=8
第三次,i=8+3=11,n=2+1=3,i>11退出
因此将text1的内容设置成str(3)里的内容