#include <String.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
$Form1 = GUICreate("Form1", 350, 123, 546, 267)
$InputNum = GUICtrlCreateInput("", 48, 24, 169, 21)
$showabel1 = GUICtrlCreateLabel("", 170, 72, 148, 33)
$btn2 = GUICtrlCreateButton("转换", 56, 72, 100, 33)
Dim $Number[10] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
Dim $chNum[10] = ["零", "一", "二", "三", "四", "五", "六", "七", "八", "九"]
Dim $getFinalNum[8]
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $btn2
Local $read = GUICtrlRead($InputNum)
Local $checkLen = StringLen($read)
Local $chNum, $show, $fullNum
For $i = 1 To $checkLen Step + 1
$checkNum = StringMid($read, $i, 1)
For $s = 0 To UBound($Number) - 1
If $checkNum == $Number[$s] Then
$getNum = $chNum[$s]
EndIf
Next
$show &= $getNum
Next
$getFinalNum[0] = $show
$getFinalNum[1] = _StringInsert($show, "十", 1)
$getFinalNum[2] = _StringInsert(_StringInsert($show, "百", 1), "十", 3)
$getFinalNum[3] = _StringInsert(_StringInsert(_StringInsert($show, "千", 1), "百", 3), "十", 5)
$getFinalNum[4] = _StringInsert(_StringInsert(_StringInsert(_StringInsert($show, "万", 1), "千", 3), "百", 5), "十", 7)
$getFinalNum[5] = _StringInsert(_StringInsert(_StringInsert(_StringInsert(_StringInsert($show, "十", 1), "万", 3), "千", 5), "百", 7), "十", 9)
$getFinalNum[6] = _StringInsert(_StringInsert(_StringInsert(_StringInsert(_StringInsert(_StringInsert($show, "百", 1), "十", 3), "万", 5), "千", 7), "百", 9), "十", 11)
$getFinalNum[7] = _StringInsert(_StringInsert(_StringInsert(_StringInsert(_StringInsert(_StringInsert(_StringInsert($show, "千", 1), "百", 3), "十", 5), "万", 7), "千", 9), "百", 11), "十", 13)
For $i = 0 To UBound($getFinalNum) - 1
If $checkLen == ($i + 1) Then
$fullNum = $getFinalNum[$i]
EndIf
Next
GUICtrlSetData($showabel1, $fullNum)
EndSwitch
WEnd