Subscribed unsubscribe Subscribe Subscribe

yukicoder No.47 ポケットを叩くとビスケットが2倍

Problem

No.47 ポケットを叩くとビスケットが2倍 - yukicoder

Solution

Code

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        int N = Integer.parseInt(reader.readLine());
        int i = 1;
        int counter = 0;
        while (i < N) {
            i = i * 2;
            counter+=1;
        }
        System.out.println(counter);

    }
}