public static void printX(int m) {
for (int x = 1; x <= m; x++) {
for (int y = 1; y <= m; y++) {
if (x == y || x + y == m + 1) {
System.out.print("*");
} else {
System.out.print(" ");
}
}
System.out.println();
}
}
public static void main(String[] args) {
printX(10);
}