1. 16.Print the RMB amount

    #coding:utf-8
    
    # method 1
    a=-20700450
    bigFormat={0:u'零',1:u"壹",2:u"贰",3:u'叁',4:u'肆',5:u'伍',6:u'陆',7:u'柒',8:u'捌',9:u'玖'}
    unit =['',u'拾',u'佰',u'仟',u'万']
    
    rmb=""
    if a!=abs ...
    read more
  2. 12.The parity of the non zero at the end

    def count(num,i):
        if num==0:
            return 0
        if num%i==0:
            return 1+count(num/i,i)
        else:
            return 0
    
    def countodd(list):
        count2=0
        count5=0
        for i in range(len(list)):
            count2 += count(list[i], 2)
            count5 += count(list[i], 5)
    
        if count2>count5:
            return 0 ...
    read more
  3. 11.The number of end 0

    def count(num,i):
        if num==0:
            return 0
        if num%i==0:
            return 1+count(num/i,i)
        else:
            return 0
    
    def countzero(list):
        count2=0
        count5=0
        for i in range(len(list)):
            count2 += count(list[i], 2)
            count5 += count(list[i], 5)
    
        if count2>count5:
            return count5 ...
    read more

« Page 19 / 21 »

blogroll

social