To give you a floating-point number, an integer, to find the integer of floating-point numbers.
Train of thought: large number of solutions, pay attention to deal with the redundant 0 and the previous redundant 0, as well as the Java scientific counting method problem.
More Wonderful content: http://www.bianceng.cnhttp://www.bianceng.cn/Programming/sjjg/
Import java.math.*;
Import Java.util.Scanner; public class Main {public static void main (string[] args) {//TODO auto-generated method Stub/*
sss*/BigDecimal A, C, D;
int b;
Scanner cin = new Scanner (system.in);
while (Cin.hasnext ()) {a = Cin.nextbigdecimal ();
b = Cin.nextint ();
A = A.pow (b);
String s; s = a.toplainstring ();
Avoidance of scientific notation (if used a.tosting will be stored as scientific notation) int start = 0;
while (S.charat (start) = = ' 0 ') {//a.charat (b) takes the character start++ labeled B in a string;
int end = S.length ()-1;
while (S.charat (end) = = ' 0 ') {end--; if (S.charat (end) = = '. ')
{end--;
for (int i = start; I <= end; ++i) {System.out.print (S.charat (i));
} System.out.println (); System.out.println ();//subtract-, add+, multiply* divide/} cin.close (); }} exponentiation