posts - 2, comments - 0, trackbacks - 0, articles - 1

          poj_1001 java

          Posted on 2011-10-27 23:37 應該干點什么 閱讀(200) 評論(0)  編輯  收藏 所屬分類: Poj-ACM
           1import java.util.*;
           2import java.io.*;
           3import java.math.*;
           4
           5public class poj_1001{
           6    
           7    public static void main(String rgs[]) throws Exception
           8    {
           9        Scanner in=new Scanner(new BufferedInputStream(System.in));
          10        while(in.hasNext()){
          11            BigDecimal bd = in.nextBigDecimal();  
          12            int power = in.nextInt();
          13            BigDecimal result = bd.pow(power);  
          14            String s = result.stripTrailingZeros().toPlainString();
          15            if(s.startsWith("0")){
          16                s=s.substring(1);
          17            }

          18            System.out.println(s);
          19       }

          20      
          21    }

          22}

          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          主站蜘蛛池模板: 青川县| 迁安市| 乌海市| 介休市| 大名县| 秦皇岛市| 栾城县| 乐平市| 祁连县| 克山县| 佳木斯市| 渝北区| 辰溪县| 白朗县| 山阳县| 崇信县| 枣强县| 会泽县| 永川市| 长泰县| 偏关县| 常山县| 兴海县| 龙海市| 平顺县| 饶平县| 洞头县| 抚顺市| 祁东县| 都昌县| 康马县| 东港市| 长沙县| 关岭| 丽水市| 九江市| 桃源县| 福泉市| 车致| 香河县| 阿巴嘎旗|