用vb程序把 贰转换成数字2
发布网友
发布时间:2024-10-08 16:44
我来回答
共3个回答
热心网友
时间:2024-12-08 06:07
添加一个命令, 再加两个文本框,文本框1 输入你要产生的组数
按命令后则文本框2产生随机数:
下面的例子是产生1~20的, 21~46的比照一下。
Dim num() As Integer
nn = Val(TextBox1.Text)
If mm > 20 Then
MsgBox "Wrong number input, please input again"
Exit Sub
End If
ReDim num(nn) As Integer
Randomize
For i = 0 To nn - 1
aa = Int(Rnd() * 20 + 1)
num(i) = aa
If i > 0 Then
Dim flag As Boolean
Judge:
flag = False
For j = 0 To i - 1
If num(i) = num(j) Then
flag = True
num(i) = Int(Rnd() * 20 + 1)
GoTo Judge
End If
Next j
End If
Next i
For i = 0 To nn - 1
result = result & num(i) & " "
Next i
TextBox2.Text = result
End Sub
热心网友
时间:2024-12-08 06:08
dim x
x="贰"
if x="贰" then x=2
热心网友
时间:2024-12-08 06:08
你是要写大小写人民币转换程序吗