VB编程共12题,高手请进,做完后有赏分

2025-02-26 01:31:56
推荐回答(5个)
回答1:

唉,帮帮你吧,控件自己画.
1)
private sub form_load()
list1.additem "Item1"
list1.additem "Item2"
list1.additem "Item3"
list1.additem "Item4"
end sub
private C1_click()
text1.text1=text1.text+list1.text+chr(13)+chr(10)
end sub
2)
private Cmd1_click()
dim a as integer,s as long,i as integer
a=inputbox("请输入:")
s=1
for i=1 to a
s=s*i
next i
text1.text=s
end sub
3)
private command1_click()
dim a as integer
a=inputbox("请输入一个月份:")
select case a
case 1,2,3:text1.text=str(a)+"月份是春季"
case 4,5,6:text1.text=str(a)+"月份是夏季"
case 7,8,9:text1.text=str(a)+"月份是秋季"
case 10,11,12:text1.text=str(a)+"月份是冬季"
case else:text1.text="输入月份无效!"
end select
end sub
4)
private sub form_click()
dim i as integer,a(1 to 16) as integer,j as integer
for i=1 to 16
radomize
a(i)=int(rnd()*100)
next i
for i=1to 4
for j=1 to 4
text1.text=text1.text+str(a(1+(j-1)*4))
next j
text1.text=text1.text+chr(13)+chr(10)
next i
text1.text=text1.text+"对角线:"+str(a(1))+str(a(6))+str(a(11))+str(a(16))
end sub
5)private sub command1_click()
dim i as integer,n as integer,s as integer,k as integer
n=inputbox("输入N的值:")
for i=1 to n
k=k+i
s=s+k
next i
text1.text=s
end sub
没经过测试,可能有些输入上的小毛病,请自行修改.

回答2:

题目太多,分数太少.....
如果每道题目50分的话,PM给我你的邮箱

回答3:

汗 楼上的 还真的做的..真有这闲情

回答4:

=.=很吓人。没时间做

回答5:

不知道楼主到底拿这些题来做什么.
暑假作业??