import java.util.Scanner;
public class Star06 {

	public static void main(String args[]) {

		Scanner scan = new Scanner(System.in);
		System.out.print("입력하세요 >> ");
		int in = scan.nextInt();
		int star = 1;

		for (int line = 1; line <= in; line++) {
			for (int k = 1; k <= in; k++) {
				System.out
						.print(((k >= star + 1) && (k <= in - star)) ? "  "
								: "* ");
			}
			if (line <= in / 2) {
				star++;
			} else {
				star--;
			}
			System.out.println();
		}
	}
}

+ Recent posts