Local $CountM = 0, $CountF = 0
Local $i = 1, $j = 1
Local $Result
$Male="什么"
$Female="什么"
For $i=1 To StringLen($Male)
If Asc(StringMid($Male, $i, 1))<127 Then
$CountM = Abs(StringRight($CountM - StringRight(Asc(StringMid($Male, $i, 1)), 2), 2))
Else
$CountM = Abs(StringRight($CountM - StringRight(Asc(StringMid($Male, $i, 1)), 2), 2))
$bin=StringToBinary(StringMid($Male, $i, 1))
$CountM = Abs(StringRight($CountM - StringRight(Dec(Hex(BinaryMid($bin,2,1))), 2), 2))
EndIf
Next
For $j=1 To StringLen($Female)
If Asc(StringMid($Female, $i, 1))<127 Then
$CountF = StringRight($CountF + StringRight(Asc(StringMid($Female, $j, 1)), 2), 2)
Else
$CountF = StringRight($CountF + StringRight(Asc(StringMid($Female, $j, 1)), 2), 2)
$bin2=StringToBinary(StringMid($Female, $i, 1))
$CountF = Abs(StringRight($CountF - StringRight(Dec(Hex(BinaryMid($bin2,2,1))), 2), 2))
EndIf
Next
$Result = 10 * StringRight($CountM - $CountF, 1) + StringRight($CountM + $CountF, 1)
If (StringRight($CountM, 1) < 5 And StringRight($CountF, 1)<>9) Then $Result += 1
$Result = 100 - $Result
MsgBox(0,"",$Result)
试试 |