Skip to content

Commit

Permalink
手残了,非常低级的bug...
Browse files Browse the repository at this point in the history
  • Loading branch information
BuglessCoder authored Mar 7, 2017
1 parent 344bd14 commit 474967a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions 人民币金额打印.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@
ans = "负"
a = -a
for i in range(0,len(str(a))):
if str(a)[i]!='0' or (len(str(a)) == 0 and i == 0):
if str(a)[i]!='0' or (len(str(a))-i-1 == 0 and i == 0):
ans = ans+b[int(str(a)[i])]
if (len(str(a))-i-1)%4!=0:
ans = ans+c[len(str(a))-i-1]
if (len(str(a))-i-1)%4 == 0:
ans = ans+c[len(str(a))-i-1]
if str(a)[i] == '0':
if i!=len(str(a))-1:
if str(a)[i+1] == 0:
if str(a)[i+1] == '0':
continue
if (len(str(a))-i-1)%4!=0:
ans = ans+b[0]
print(ans)
print(ans)

0 comments on commit 474967a

Please sign in to comment.