奥林匹克由来:写出下列程序段的运行结果

来源:百度文库 编辑:神马品牌网 时间:2024/05/01 06:14:45
1.
Private sub command1_click()
dim i as integer
for i=3 to 10
if int(i/5)=i/5 then
exit for
end if
next i
print i
end sub

2.
Private Sub Command1_Click()
Dim x, y As Integer
x = 3
Select Case x
Case 1
y = 2
Case 2
y = 3
Case 3
y = 4
Case Else
y = 10
End Select
Form1.Print y
End Sub
3.
Private sub command1_click()
dim a,b,x as integer
b=1
for a=1 to 9
x=a*b
form1.print a & ”*” & b & ”=” & x
next a
end sub
4.
Private sub command1_click()
Dim m,n as integer
For m=3 to 9
For n=2 to m-1
If int(m/n)=m/n then
Exit for
End if
If n=m-1 then
Print m
End if
Next n
Next m
End sub

楼上的,不懂得尊重别人,就不会得到别人的尊重!!

1、 5
int(i/5)=i/5 与 (i mod 5)=0 差不多,为了判断是否整除。当i=5时,整除,exit for 跳出for循环。
2、 4
为什么这样的都拿来问??难道你学编程,连这么简单的分支程序都不会吗?
3、再问这样的题就真的会让人鄙视了。
1*1=1
2*1=2
3*1=3
4*1=4
5*1=5
6*1=6
7*1=7
8*1=8
9*1=9

4、 3 5 7

鄙视VB,C\C++赞的说。