poj1001
来源:互联网 发布:1942芬兰怪物知乎 编辑:程序博客网 时间:2024/06/05 06:12
import java.io.BufferedInputStream;import java.math.BigDecimal;import java.util.Scanner;public class poj1001 { public static void main(String[] args) { Scanner cin=new Scanner(new BufferedInputStream(System.in)); BigDecimal a,s; int p; while(cin.hasNext()) { a=cin.nextBigDecimal(); p=cin.nextInt(); s=BigDecimal.valueOf(1); for(int i=1;i<=p;++i) { s=s.multiply(a); } s=s.stripTrailingZeros(); if(s.compareTo(BigDecimal.valueOf(1))<0) { String ans=s.toPlainString(); for(int i=1;i!=ans.length();++i) { System.out.print(ans.charAt(i)); } System.out.println(); } else { String ans=s.toPlainString(); System.out.println(ans); } } }}
0 0
- POJ1001
- poj1001
- poj1001
- POJ1001
- POJ1001
- poj1001
- POJ1001
- poj1001
- POJ1001
- POJ1001
- poj1001
- POJ1001
- POJ1001
- poj1001
- POJ1001
- POJ1001
- POJ1001
- poj1001
- C++设计模式之备忘录模式
- libxml2剖析(1):功能特性
- 进程里的几个栈
- PostgreSQL 中文资料汇总
- User account has expired
- poj1001
- Linux内核Crash分析
- Python class
- Android 自定义Dialog类,并在Activity中实现按钮监听事件
- 过滤关联表属性
- 关于九宫格的适配布局
- Linux下Graphite的安装及部署
- 数组排序
- 序列化