Dim a() As String
a = Split(Text1.Text, " ")
For i = 0 To UBound(a)
n = 0
For j = i + 1 To UBound(a)
If a(i) = "" Then Exit For
If a(i) = a(j) And a(i) <>"" Then
n = n + 1
a(j) = ""段衡芦
End If
Next
If a(i) <>握带拦扰 "" Then
Text2.Text = Text2.Text &a(i) &"出现" &n + 1 &"次" &vbCrLf
End If
Next
End Sub
PrivateSub
Form_Click()
Dim
A
As
String
Dim
I
As
Integer
A
=
InputBox("请输入0-9组成谈含的数字")
Dim
B(0
To
9)
As
Integer,
J
As
Integer
For
I
=
1
To
Len(A)
If
Mid(A,
I,
1)
<>
"
"
Then
J
=
Val(Mid(A,
I,
1))
B(J)
=
B(J)
+
1
J
End
If
Next
Dim
max
As
Integer,
iMax
As
Integer
iMax
=
0
For
I
=
1
To
9
If
B(iMax)
<
B(I)
Then
iMax
=
I
Next
"最高频率数:"
iMax
"出含扒笑现频率是"
B(iMax)
End
Sub
正好,刚解答完此猜的
Private Sub Text1_Change()
' 单字节发送数据
X1 = Val(Text1.Text)
X2 = Val(Text2.Text)
X2 念郑= Val(Text3.Text)
If X1 < 0 Or X1 > 255 Then ' 判断 范围If X2 < 0 Or X2 > 255 Then If X3 < 0 Or X3 > 255 Then
X1 = 0
Text1.Text = 0
End If
sendx$ = "A" + Chr(X1) + Chr(X2) + Chr(X3) + "5" ' A 是 同步字 5也是的
Call send5x(sendx$)
End Sub
Sub send5x(c$)
'扒高卜 打开 COM1 可以 用鼠标 设置好 固定使用 COM1
' 发数据 MSComm1.Output =
End Sub
单片机
看是什么新片了
if(RI){ //查询是否有数据接收
ldat=SBUF //数据暂存于变量中
RI=0 春穗//重新清0等待接收
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)