public static void main(String[] args) {
rhombus(10);
}
public static void rhombus(int length) {
for (int i = 0; i <= length * 2; i++) {
blank(Math.abs(i - length));
star(i > length ? (length*2 - i) * 2 + 1 : i * 2 + 1);
}
}
public static void blank(int length) {
for (int i = 0; i < length; i++) {
System.out.print(" ");
}
}
public static void star(int length) {
for (int i = 0; i < length; i++) {
System.out.print("*");
}
System.out.println();
}
纯手工写的.