Dim k1 As Integer, k2 As Integer, k3 As Integer
Open AppPath & "\123txt" For Input As #1
Open AppPath & "\组六txt" For Output As #2
Do Until EOF(1)
Line Input #1, s
If InStr(s, "组六包号") Then
t = Split(Replace(s, "组六包号", ""), ",")
For k1 = 0 To UBound(t) - 2
For k2 = 1 To UBound(t) - 1
For k3 = 2 To UBound(t)
If k1 <> k2 And k2 <> k3 And k1 <> k3 Then Print #2, t(k1) & t(k2) & t(k3)
Next
Next
Next
ElseIf InStr(s, "组六胆拖胆码:") Then
t = Split(Replace(s, "组六胆拖胆码:", ""), "拖码:")
t1 = Split(t(1), ",")
If InStr(t(0), ",") Then
For k1 = 0 To UBound(t1)
Print #1, Replace(t(0), ",", "") & t1(k1)
Next
Else
For k1 = 1 To UBound(t1) - 1
For k2 = 2 To UBound(t1)
If k1 <> k2 Then Print #2, t(0) & t1(k1) & t1(k2)
Next
Next
End If
ElseIf InStr(s, "组六和值") Then
t = Split(Replace(s, "组六和值", ""), ",")
For k1 = 0 To UBound(t)
For k2 = 0 To 999
s1 = Format(k2, "000")
If Val(Left(s1, 1)) + Val(Mid(s1, 2, 1)) + Val(Right(s1, 1)) = Val(t(k1)) And Val(Left(s1, 1)) < Val(Mid(s1, 2, 1)) And Val(Mid(s1, 2, 1)) < Val(Right(s1, 1)) Then Print #2, s1
Next
Next
End If
Loop
Close #2
Close #1Dim s As String
s = "12345"
CurrentX = (ScaleWidth - TextWidth(s)) \ 2
CurrentY = (ScaleHeight - TextHeight(s)) \ 2
Print s
下面的代码是在窗体的左下角显示数字88888
s = "88888"
CurrentX = 0
CurrentY = ScaleHeight - TextHeight(s)
Print s
下面的代码是在窗体的(600, 450)的位置显示字符hello
s = "helllo"
CurrentX = 600
CurrentY = 450
Print s计算机想出的数字在VB中可以用随机函数表示。比如,计算机模拟一个成绩,想出一个0~100的随机整数,可以用以下的方法实现:
Randomize
x=Int(Rnd 101)
1、首先在电脑中找到并打开VB软件,找到一句输出的函数。
2、然后在其数组变量中,套上一个Str函数。
3、这里注意函数的关键字,是没有区分大小写的。
4、然后函数是可以多个嵌套使用。
5、最后点击运行按钮,这样就可以成功运行测试,如下图所示,转换就完成了。
private sub form_click()cls
dim i as integer,m as integer,n as integer,k as integer
m=int(inpurbox(“输入一个整数”;“m=”;1234)
print “原数=”;m
n=0
do while(m>0)
k=m mod 10
m=m\10
n=n10+k
loop
print “逆序数=”;n
end sub
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)