████400分████VB编程███████████

问题在这里:http://hi.baidu.com/qiangfen再去这个网址答一次,我采纳同一个人,就可以获得400悬赏分http://zhidao.baidu.co... 问题在这里:
http://hi.baidu.com/qiangfen

再去这个网址答一次,我采纳同一个人,就可以获得400悬赏分
http://zhidao.baidu.com/question/74943187.html
有问题,按特码出现几率排列为什么不会排列?
点其他按扭则显示

实时错误'3':
类型不匹配
展开
 我来答
swx1995
2008-11-15 · TA获得超过2696个赞
知道大有可为答主
回答量:1477
采纳率:0%
帮助的人:2366万
展开全部
OK 解决!完全按照题目意思。
说明:放置:一个TextBox(Name:Text1,MultiLine: True,ScrollBars: 2,Text: ""),一个按钮(Name:Command2,Caption:"按特码出现几率排列"),一个按钮(Name:Command3,Caption:"按特码头数出现几率排列"),一个按钮(Name:Command4,Caption:"按特码尾数出现几率排列"),一个按钮(Name:Command5,Caption:"按特码大、小数排列"),一个按钮(Name:Command6,Caption:"按特码单、双数排列")。

复制以下代码:
Private Type LineStr
Number As String
Shows() As Integer
Max As Integer
End Type

Dim fp As String
Dim n() As String
Dim m() As String

Const tabLeft As Integer = 7
Const tabRight As Integer = 6

Private Sub Command2_Click()
Dim a() As LineStr, h As Integer, i As Integer, j As Integer, p As Integer, k() As String
Dim copy As LineStr, tmpStr As String

Text1.Text = ""
For p = 1 To UBound(n)
k = Split(m(p), " ")

ReDim Preserve a(p)
ReDim Preserve a(p).Shows(UBound(k))

For i = 0 To UBound(k)
a(p).Number = n(p)
For j = 0 To UBound(k)
a(p).Shows(j) = k(j)
Next
Next

If a(p).Shows(0) = 0 Then
a(p).Max = -1
Else
a(p).Max = UBound(k)
End If

DoEvents
Next

For h = 1 To UBound(a) - 1
For i = 1 To UBound(a) - 1
If a(i + 1).Max > a(i).Max Then

copy.Max = a(i + 1).Max
copy.Number = a(i + 1).Number
ReDim copy.Shows(UBound(a(i + 1).Shows))
For j = 0 To UBound(a(i + 1).Shows)
copy.Shows(j) = a(i + 1).Shows(j)
Next

a(i + 1).Max = a(i).Max
a(i + 1).Number = a(i).Number
ReDim a(i + 1).Shows(UBound(a(i).Shows))
For j = 0 To UBound(a(i).Shows)
a(i + 1).Shows(j) = a(i).Shows(j)
Next

a(i).Max = copy.Max
a(i).Number = copy.Number
ReDim a(i).Shows(UBound(copy.Shows))
For j = 0 To UBound(copy.Shows)
a(i).Shows(j) = copy.Shows(j)
Next

End If
Next
Next

DoEvents

For i = 1 To UBound(a)
tmpStr = "特码:" & Trim(a(i).Number)
Text1.Text = Text1.Text & tmpStr & Space(tabLeft - Len(tmpStr))
For q = 0 To UBound(a(i).Shows)
tmpStr = IIf(a(i).Shows(q) = 0, "(无)", a(i).Shows(q) & "期")
Text1.Text = Text1.Text & tmpStr & Space(tabRight - Len(tmpStr))
Next
Text1.Text = Text1.Text & vbCrLf
DoEvents
Next
End Sub

Private Sub Command3_Click()
Dim p As Integer, q As Integer, k() As Integer, u() As String, t As Integer
ReDim Preserve k(0)
For p = 1 To UBound(n)
t = CInt(Left(n(p), 1))
u = Split(m(p), " ")
If t > UBound(k) Then ReDim Preserve k(t)
k(t) = k(t) + UBound(u) + 1
Next
Text1.Text = ""
For q = LBound(k) To UBound(k)
If k(q) > 0 Then Text1.Text = Text1.Text & Trim(Str(q)) & "字头共出现" & Trim(Str(k(q))) & "期" & vbCrLf
Next
End Sub

Private Sub Command4_Click()
Dim p As Integer, q As Integer, k() As Integer, u() As String, t As Integer
ReDim Preserve k(0)
For p = 1 To UBound(n)
t = CInt(Right(n(p), 1))
u = Split(m(p), " ")
If t > UBound(k) Then ReDim Preserve k(t)
k(t) = k(t) + UBound(u) + 1
Next
Text1.Text = ""
For q = LBound(k) To UBound(k)
If k(q) > 0 Then Text1.Text = Text1.Text & Trim(Str(q)) & "字尾共出现" & Trim(Str(k(q))) & "期" & vbCrLf
Next
End Sub

Private Sub Command5_Click()
Dim p As Integer, k() As Integer, u() As String
ReDim Preserve k(1)
For p = 1 To UBound(n)
u = Split(m(p), " ")
If n(p) >= 25 And n(p) <> 49 Then
k(0) = k(0) + UBound(u) + 1
Else
k(1) = k(1) + UBound(u) + 1
End If
Next
Text1.Text = ""
Text1.Text = Text1.Text & "小数共出现" & Trim(Str(k(1))) & "期" & vbCrLf
Text1.Text = Text1.Text & "大数共出现" & Trim(Str(k(0))) & "期" & vbCrLf
End Sub

Private Sub Command6_Click()
Dim p As Integer, k() As Integer, u() As String
ReDim Preserve k(1)
For p = 1 To UBound(n)
u = Split(m(p), " ")
If n(p) Mod 2 = 1 And n(p) <> 49 Then
k(0) = k(0) + UBound(u) + 1
Else
k(1) = k(1) + UBound(u) + 1
End If
Next
Text1.Text = ""
Text1.Text = Text1.Text & "单数共出现" & Trim(Str(k(0))) & "期" & vbCrLf
Text1.Text = Text1.Text & "双数共出现" & Trim(Str(k(1))) & "期" & vbCrLf
End Sub

Private Sub Form_Load()
fp = App.Path & "\1.ini"

ReDim Preserve n(0)
ReDim Preserve m(0)

Dim s As String, l As String, i As Integer

Open fp For Input As #1
Do Until EOF(1)
Line Input #1, s
If IsNumeric(Left(s, 2)) = True Then
ReDim Preserve n(UBound(n) + 1)
ReDim Preserve m(UBound(m) + 1)
n(UBound(n)) = Trim(Left(s, InStr(1, s, " ")))
m(UBound(m)) = IIf(InStr(1, s, "无") = 0, Trim(Right(s, Len(s) - InStr(1, s, " "))), "0")
End If
Loop
Close #1
End Sub

'Edit By swx1995 at 2008-11-15
dvbfny1
2008-11-14
知道答主
回答量:3
采纳率:0%
帮助的人:0
展开全部
好吃不忽悠,好劲道方便面????????????????
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
parksunming
2008-11-14 · 超过40用户采纳过TA的回答
知道小有建树答主
回答量:124
采纳率:0%
帮助的人:99.3万
展开全部
触犯了我个人道德底线,拒绝给你写,希望楼下跟帖一起BS这样的人~~
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
lgf126
2008-11-14 · TA获得超过1101个赞
知道小有建树答主
回答量:1077
采纳率:33%
帮助的人:468万
展开全部
请问楼主用VB2005版本是否可以?
机子里安装了VS2005,没VB6
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
gqhxf1985
2008-11-14 · TA获得超过552个赞
知道小有建树答主
回答量:1225
采纳率:0%
帮助的人:756万
展开全部
S B
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
mying_2002
2008-11-14 · TA获得超过1035个赞
知道小有建树答主
回答量:295
采纳率:0%
帮助的人:302万
展开全部
试试看吧。
不知道为什么要发两个。
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
收起 更多回答(5)
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式