题解 | #奇数位丢弃#
奇数位丢弃
http://www.nowcoder.com/practice/196141ecd6eb401da3111748d30e9141
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while(sc.hasNextInt()) {
int n = sc.nextInt();
int ans = 1;
n += 1;
while(ans <= n) {
ans <<= 1;
}
System.out.println((ans >> 1) - 1);
}
}
}