用*打印一个菱形(利用for循环嵌套)
class Rhombus{
public static void main(String[] args){
for(int i = 1;i<=6;i++){
for(int j=1;j<=6-i;j++){
System.out.print(" ");
}
for(int k=1;k<=i;k++){
System.out.print("*");
}
for(int n=1;n<=i-1;n++){
System.out.print("*");
}
System.out.println();
}
for(int m = 1;m<=5;m++){
for(int a=1;a<=m;a++){
System.out.print(" ");
}
for(int b=1;b<=6-m;b++){
System.out.print("*");
}
for(int c=1;c<=5-m;c++){
System.out.print("*");
}
System.out.println();
}
}
}