class Main {
public static void main(String[] args) {
System.out.println("Hello World!");
int c = 0;
do{
System.out.println("["+c+"]: "+calc(c));
}while(c++ <10);
}
/**
* 向上取2的次幂
*/
public static int calc(int c){
int n = c - 1;
n |= n >>> 1;
n |= n >>> 2;
n |= n >>> 4;
n |= n >>> 8;
n |= n >>> 16;
return n<1 ? 1:n+1;
}
}