728x90
출처-https://www.acmicpc.net/problem/10991
728x90
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner scan=new Scanner(System.in);
int N=scan.nextInt();
for (int i=1;i<=N;i++) {
for (int j=N-i;j>0;j--)
System.out.print(" ");
System.out.print("*");
for (int j=1;j<i;j++)
System.out.print(" *");
System.out.println();
}
}
}
728x90
'Problem Solving > BOJ' 카테고리의 다른 글
[백준, BOJ 11052] 카드 구매하기 (java) (0) | 2020.08.18 |
---|---|
[백준, BOJ 10992] 별 찍기 - 17 (java) (0) | 2020.08.14 |
[백준, BOJ 2446] 별 찍기 - 9 (java) (0) | 2020.08.14 |
[백준, BOJ 2522] 별 찍기 - 12 (java) (0) | 2020.08.13 |
[백준, BOJ 2445] 별 찍기 - 8 (java) (0) | 2020.08.13 |