public class maxN { public static void main(String[] args) { System.out.println(log2n(20)); } private static int log2n(int n) { return (n > 1) ? 1 + log2n(n / 2) : 0; }}
No comments:
Post a Comment