求救...关于VB的编程...高人指点

来源:百度知道 编辑:UC知道 时间:2024/05/14 03:58:12
编程.
已知:S=1+2+22+23+…2n-1,求满足S<2000的N的最大值。

x=1
do
x=x+2
print x
loop until x=7
程序运行后,要求执行___________次循环体,请填空。

function m(x as integer,y as integer) as integer
m=iif(x>y,x,y)
end function

private sub command1_click()
dim a as integer,b as integer
a=1
b=2
print m(a,b)
end sub
程序运行后,单击命令按钮,输出结果为__________。

input a,b
r=1
do while r<>0
r=a-int(a/b)*b
a=b
b=r
loop
print “GCD=”;a
运行结果是:____________。

a=2
for x=5 to a step –1
print x
next x
运行结果是:____________。

private sub command1_click()
a=0
for i=1 to 2
for j=1 to 4
if j mod 2<>0 then
a=a+1
end if
a=a+1
next j
next i
print a
end sub
程序运行后,单击命令按钮,输出结果是_____________。

请各位高人们帮下我的忙..

编程.
已知:S=1+2+22+23+…2n-1,求满足S<2000的N的最大值。

这个数组看不懂,什么规律?怎么变化的??

x=1
do
x=x+2
print x
loop until x=7
程序运行后,要求执行____3____次循环体,请填空。

function m(x as integer,y as integer) as integer
m=iif(x>y,x,y)
end function

private sub command1_click()
dim a as integer,b as integer
a=1
b=2
print m(a,b)
end sub
程序运行后,单击命令按钮,输出结果为____2____。

input a,b
r=1
do while r<>0
r=a-int(a/b)*b
a=b
b=r
loop
print “GCD=”;a
运行结果是:__________。

没有输入a,b,条件不足

a=2
for x=5 to a step –1
print x
next x
运行结果是:____5432______。

private sub command1_click()
a=0
for i=1 to 2
for j=1 to 4
if j mod 2<>0 then
a=a+1
end if
a=a+1
next j
next i
print a
end sub
程序运行后,单击命令按钮,输出结果是_____12_____。

3 0