public class Test {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.println("输入n:");
int n = scanner.nextInt();
int i[][] = new int[n][n];
for (int j = 0; j < > > for (int k = 0; k < > > if ((j == k) || (j + k) == (n -1)) {
i[j][k] = 1;
} else {
i[j][k] = 0;
}
}
}
for (int j = 0; j < > > for (int k = 0; k < > > System.out.print(i[j][k] + " ");
}
System.out.println();
}
}
}