vb中关于冒泡排序问题以及统计的问题,只剩下15分了,全给了,谢谢

来源:百度知道 编辑:UC知道 时间:2024/05/25 04:09:28
1)要求在一个inputbox中输入几个数(自己随意输入,以10个数值为例),输入后显现在窗体上是排序好的数值
2)下面的一篇文章,要求统计出各个字母(区分大小写,以abcd这四个字母为例)和数值出现的次数,并且将其输入到一个文档中
Andrew Cuomo said he hoped to recoup $80m (£55m) of bonus payments - which amounts to about half of the $165 million paid by AIG on 15 March.
The US rescued AIG with bail-out funds totalling $170bn since September 2008.
Treasury Secretary Timothy Geithner is due to testify on Tuesday on the need to reform the US financial system.

第一题
Private Sub Command1_Click()
Dim n(10)
For i = 1 To 10
n(i) = Val(InputBox("d"))
Next i

For k = 1 To i - 1
For j = 1 To i - 2
If n(j) > n(j + 1) Then
T = n(j + 1)
n(j + 1) = n(j)
n(j) = T
End If
Next j
Next k
Close #1

For i = 1 To 10
Print n(i);
Next i

End Sub

第二题

Private Sub Command1_Click()
a = "Andrew Cuomo said he hoped to recoup $80m (£55m) " & _
"of bonus payments - which amounts to about half of the $165 million paid by AIG on 15 March." & _
"The US rescued AIG with bail-out funds totalling $170bn since September 2008." & _
"Treasury Secretary Timothy Geithner is due to testify on Tuesday on the need to reform the US financial system"
For i = 1 To Len(a)
x = Mid(