HDU 1063 Exponentiation
JAVA 水过
import java.io.*; import java.util.*; import java.math.*; public class aa { public static void main( String[] args ) { BigDecimal a,b; int c; Scanner cin = new Scanner(System.in); while( cin.hasNext() ) { a = cin.nextBigDecimal(); b = BigDecimal.valueOf(1); c = cin.nextInt(); for( int i = 0; i < c; ++i ) b = b.multiply(a); String str = b.stripTrailingZeros().toPlainString(); if( str.charAt(0) == '0' ) System.out.println( str.substring(1) ); else System.out.println( str ); } } }
本人还是新手 ,转载请注明来自Lvsi‘s home