HDU 6033 Add More Zero(思維取對數)

Add More Zero

題解:水題,取loglog即可。

代碼

import java.util.Scanner;

public class Main {
    public static void main(String[]args){
        Scanner in = new Scanner(System.in);
        int t = 1;

        while (in.hasNext())
        {
            int m = in.nextInt();
            int cc = (int)(Math.log10(2)*m);
            System.out.println("Case #"+(t++)+": "+cc);
        }
        in.close();
    }
}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章