def test(money):
cnNums = ["零","壹","贰","叁","肆","伍","陆","柒","捌","玖"]
cnIntRadice = ["", "拾", "佰", "仟"]
cnIntUnits = ["", "万", "亿", "兆"]
cnDecUnits = ["角", "分", "毫", "厘"]
cnInteger = "整"
cnIntLast = "元"
maxNum = 999999999999999.9999
ChineseStr = ""
parts =[]
Symbol = ""
if money == "":
return ""
money = float(money)
if money >= maxNum:
return ""
if money == 0:
ChineseStr = cnNums[0] + cnIntLast + cnInteger
return ChineseStr
if money < 0:
money = -money
Symbol = "负 "
money = str(money)
if money.find(".") == -1:
IntegerNum = money
DecimalNum = ""
else:
parts = money.split(".")
IntegerNum = parts[0]
DecimalNum = parts[1][0:4]
if int(IntegerNum) > 0:
zeroCount = 0
IntLen = len(IntegerNum)
for i in range(0,IntLen):
n = IntegerNum[i:i+1:1]
p = IntLen - i - 1
q = p // 4
m = p % 4
if n == "0":
zeroCount +=1
else:
if zeroCount > 0:
ChineseStr += cnNums[0]
zeroCount = 0
ChineseStr += cnNums[int(n)] + cnIntRadice[m]
if m == 0 and zeroCount < 4:
ChineseStr += cnIntUnits[q]
ChineseStr += cnIntLast
if DecimalNum != "":
decLen = len(DecimalNum)
for i in range(0,decLen):
n = DecimalNum[i:i+1:1]
if n != "0":
ChineseStr += cnNums[int(n)] + cnDecUnits[i]
if ChineseStr == "":
ChineseStr += cnNums[0] + cnIntLast + cnInteger
elif DecimalNum == "0":
ChineseStr += cnInteger
ChineseStr = Symbol + ChineseStr
return ChineseStr
money = input()
print(test(money))
/*
5412464.15
伍佰肆拾壹万贰仟肆佰陆拾肆元壹角伍分
45000
肆万伍仟元整
*/