- ©«¤l
- 4901
- ¥DÃD
- 44
- ºëµØ
- 24
- ¿n¤À
- 4916
- ÂI¦W
- 251
- §@·~¨t²Î
- Windows 7
- ³nÅ骩¥»
- Office 20xx
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥x¥_
- µù¥U®É¶¡
- 2010-4-30
- ³Ì«áµn¿ý
- 2024-11-19
|
¦^´_ 1# tku0216
¨Ì·Ó¨¤ÀÃÒ¦r¸¹³W«hÅçÃÒ
«D¦³®Ä¦r¸¹«h±Æ°£
¥Î¤@·s°}¦CÀx¦s¥¿½T¦r¸¹- Option Explicit
- Sub ex()
- Dim A(0 To 4) As String, Ar() As String, i&, s&
- A(0) = "A123456789"
- A(1) = "B521632157"
- A(2) = "A001"
- A(3) = "A02"
- A(4) = "S512935123"
- For i = 0 To 4
- If Pass(A(i)) Then
- ReDim Preserve Ar(s)
- Ar(s) = A(i)
- s = s + 1
- End If
- Next
- MsgBox Join(Ar, Chr(10))
- End Sub
- Function Pass(Mystr As String) As Boolean '¦r¸¹ÅçÃÒ
- Dim x, y%, k%, i%
- If Asc(Left(Mystr, 1)) < 65 Or Asc(Left(Mystr, 1)) > 90 Or Len(Mystr) <> 10 Then Pass = False: Exit Function
- k = Application.Match(Left(Mystr, 1), Array("A", "B", "C", "D", "E", "F", "G", "H", "J", "K", "L", "M", "N", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "I", "O"), 0) + 9
- y = (k Mod 10) * 9 + Int(k / 10)
- x = Array(0, 0, 8, 7, 6, 5, 4, 3, 2, 1, 1)
- For i = 2 To Len(Mystr) - 1
- y = y + Val(Mid(Mystr, i, 1)) * x(i)
- Next
- Pass = 10 - (y Mod 10) = Val(Right(Mystr, 1))
- End Function
½Æ»s¥N½X |
|