| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
为什么RE?import java.util.Scanner;
public class Main {
public static void main(String[] args) {
try {
Scanner cin = new Scanner(System.in);
long input=cin.nextLong();
long n = 0;
String str=Long.toBinaryString(input);
n=str.lastIndexOf('1');
long a=1;
a<<=(n-1);
a++;
System.out.print(a);
} catch (Exception e) {
e.printStackTrace();
}
}
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator