import java.util.Random;
import java.util.Scanner;
public class xz {
public static void main(String[] args) {
System.out.println("请输入一个整数n:");
Scanner scan=new Scanner(System.in);
int n=scan.nextInt();
System.out.println( createRndInteger( n));
}
public static long createRndInteger(int n){
Random r=new Random();
int a=r.nextInt(2);
System.out.print("产生的随机数为:" );
for(int i=1;i<=n;i++){
System.out.print(a);
}
System.out.println();
return 0;
}
import java.util.Scanner;
public class xz {
public static void main(String[] args) {
System.out.println("请输入一个整数n:");
Scanner scan=new Scanner(System.in);
int n=scan.nextInt();
System.out.println( createRndInteger( n));
}
public static long createRndInteger(int n){
Random r=new Random();
int a=r.nextInt(2);
System.out.print("产生的随机数为:" );
for(int i=1;i<=n;i++){
System.out.print(a);
}
System.out.println();
return 0;
}
}