public static void printLuoxuan(int n) {
int times = (n + 1) / 2;
int[][] arr = new int[n][n];
int count = 1;
for (int i = 0; i < times; i++) {
int x = i;
int y = i;
if (x == n / 2 && y == n / 2 && n % 2 == 1) {
arr[x][y] = count;
break;
}
while (y < n - 1 - i)
arr[x][y++] = count++;
while (x < n - 1 - i)
arr[x++][y] = count++;
while (y > i)
arr[x][y--] = count++;
while (x > i)
arr[x--][y] = count++;
}
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
System.out.print(arr[j] + "\t");
}
System.out.println();
}
}