百炼_浮点数求高精度幂 2951 (Python3)

from decimal import Decimal,getcontext
getcontext().prec = 505
while True:
    try:
        a,b=map(Decimal,input().strip().split())
        c='{:.500f}'.format(a**b).strip('0').rstrip('.')#否则计算出来的是科学计数法
        print(c)
    except EOFError:
        break

 

posted @ 2018-02-02 14:38  MapReduce  阅读(291)  评论(0编辑  收藏  举报