package zxcz;
import java.util.Scanner;
public class liubianxing {
public static void main(String orgs[]){
System.out.println("请输入六边形边长n");
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
System.out.println("下面输出边长为"+n+"的六边形");
for(int j=1;j<=2*n-1;j++){
for(int i=1;i<=3*n-2;i++){
if(j==i+n-1||j==-i+n+1||j==-i+4*n-2||j==i+2-2*n)
System.out.print("*");
else{
if((i>n&&i<2*n-1)==false)
System.out.print(" ");
}
if(i>n&&i<2*n-1){
if(j==1||j==2*n-1){
System.out.print("*");
}
else
System.out.print(" ");
}
}
System.out.println();
}
}
}