
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int N = in.nextInt();
in.close();
for (int i = 1; i <= N; i++) {
for (int j = 1; j <= N - i; j++) {
System.out.print(" ");
}
for (int k = 0; k < i; k++) {
System.out.print("*");
}
System.out.println();
}
}
}
๋๋ณด๊ธฐ
ํ๋ฆฐ ์ด์ >
11: j <= N - 1 ์ด๋ผ๊ณ ์ฐ๊ณ , j-- ๋ผ๊ณ ์ผ์
'๐ Algorithm > BOJ' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
1110 (0) | 2021.08.16 |
---|---|
10952 10951 (0) | 2021.08.15 |
10950 (0) | 2021.08.14 |
2884 (0) | 2021.08.14 |
2753 (0) | 2021.08.12 |