哆啦啊梦 @ 2022-01-15 03:31:52
代码如下
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int a=scanner.nextInt();
int sum=0;
while (sum<a*a){
int m=scanner.nextInt();
for(int k=0;k<m;k++){
System.out.print("0");
if((sum+1)%a==0) System.out.print("\n");
sum++;
}
int n=scanner.nextInt();
for(int k=0;k<n;k++){
System.out.print("1");
if((sum+1)%a==0) System.out.print("\n");
sum++;
}
}
}
}