题目链接 http://acm.hdu.edu.cn/showproblem.php?pid=1063
import java.math.BigDecimal;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scn = new Scanner(System.in);
while (scn.hasNext()) {
BigDecimal number = scn.nextBigDecimal();
number = number.pow(scn.nextInt());
String result = number.stripTrailingZeros().toPlainString();
if ('0' == result.charAt(0) && '.' == result.charAt(1)) {
result = result.substring(1);
}
System.out.println(result);
}
scn.close();
}
}
最后
以上就是无私茉莉最近收集整理的关于ACM HDOJ 1063 (Exponentiation)的全部内容,更多相关ACM内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复