import java.util.*;
public class Random {
public static void main(String args[])
{
Scanner input = new Scanner(System.in);
System.out.println("请输入n");
int n = input.nextInt();
System.out.println(createRandDemo(n));
}
private static long createRandDemo(int n) {
// TODO Auto-generated method stub
Integer value;
value= (int)(Math.random()*(int)(Math.pow(2,n)-1)+(int)Math.pow(2, n-1));
System.out.println("n的二进制表示为:"+ value.toBinaryString(value-1));//以二进制(基数 2)无符号整数形式返回一个整数参数的字符串表示形式。
return (value-1);
}
}
public class Random {
public static void main(String args[])
{
Scanner input = new Scanner(System.in);
System.out.println("请输入n");
int n = input.nextInt();
System.out.println(createRandDemo(n));
}
private static long createRandDemo(int n) {
// TODO Auto-generated method stub
Integer value;
value= (int)(Math.random()*(int)(Math.pow(2,n)-1)+(int)Math.pow(2, n-1));
System.out.println("n的二进制表示为:"+ value.toBinaryString(value-1));//以二进制(基数 2)无符号整数形式返回一个整数参数的字符串表示形式。
return (value-1);
}
}