L1-017 到底有多二 python
python实现
s=str(input()) factor1=1.0 if s[0]=="-": factor1=1.5 s=s[1:] l=len(s) count=0 for i in s: if i=="2": count+=1 factor2=1.0 if int(s)%2==0: factor2=2.0 print("{:.2f}%".format((count/l)*factor1*factor2*100))
python实现
s=str(input()) factor1=1.0 if s[0]=="-": factor1=1.5 s=s[1:] l=len(s) count=0 for i in s: if i=="2": count+=1 factor2=1.0 if int(s)%2==0: factor2=2.0 print("{:.2f}%".format((count/l)*factor1*factor2*100))