hdu 1047 Exponentiation
import java.math.BigDecimal; import java.math.BigInteger; import java.util.Scanner; public class hdu1063 { public static void main(String[] args) { Scanner cin=new Scanner(System.in); int a,i; BigDecimal b,mul; while(cin.hasNextBigDecimal()) { mul=BigDecimal.ONE; b=cin.nextBigDecimal(); a=cin.nextInt(); for(i=1;i<=a;i++) mul=mul.multiply(b); String str=mul.stripTrailingZeros().toPlainString(); if(str.charAt(0)=='0') System.out.println(str.substring(1)); else System.out.println(str); } } }
posted on 2011-05-10 08:25 more think, more gains 阅读(189) 评论(0) 编辑 收藏 举报