2024年5月3日发(作者:)

实验一

dim a(20) as interger,s(10) as interger

private sub button1_click(.....)handles

dim i%,j%

=""

for i=1 to 20

a(i)=int(rnd*101)

&=a(i)&space(6-len(a(i)))

j=a(i)10

select casej

case 0to 5

s(5)=s(5)+1

case 9to 10

s(9)=s(9)+1

case 6to 8

s(j)=s(j)+1

end select

next i

end sub

private sub button2_click(...)handles

="0-59:"&s(5)&vbcrlf

="60-69:"&s(6)&vbcrlf

="70-79:"&s(7)&vbcrlf

="80-89:"&s(8)&vbcrlf

="90-100:"&s(9)&vbcrlf

buton1

dim lamp(100)

dim i%,j%,n%

n=val()

for i=1to n

lamp(i)=0

next

for i=2 to n

for j=i to n

if j mod i=0 then

if lamp(j)=1 then lamp(j)=0

else lamp(j)=1

end if

end if

next

next