| ||||||||||
| 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:为什么RE?In Reply To:为什么RE? Posted by:SE06llm at 2007-07-06 21:57:49 .........乱了
> 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