Vb:1有a个,2有b个,3有c个,先比较abc的大小,然后在text中按大小顺序显示abc,并且abc前面都显示123?

问题描述:

Vb:1有a个,2有b个,3有c个,先比较abc的大小,然后在text中按大小顺序显示abc,并且abc前面都显示123?
例如:假设a>b>c,则text中显示
3:c 2:b a :1

用二维数组
dim abc(3,1)
abc(1,0)=1:abc(1,1)=a
abc(2,0)=2:abc(2,1)=b
abc(3,0)=3:abc(3,1)=c最后输出程序怎么写啊?For i = 1 To tmp1(0) 用二维数组dim abc(3,1)abc(1,0)=1:abc(1,1)=aabc(2,0)=2:abc(2,1)=babc(3,0)=3:abc(3,1)=c For i = 1 To 3 For j = 3 To i Step -1If abc(i,1) > abc(j,1) Thentemp = abc(i,1): temp1 = abc(i,0)abc(i,1) = abc(j,1):abc(i,0) = abc(j,0)abc(j,1) = temp:abc(j,0) = temp1End IfNextNextt=""for i=1 to 3t=t & abc(i,0) & "有" & abc(i,1)& "个"nexttext2.text=t