https://www.acmicpc.net/problem/2439
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
public class Main{
public static void main(String[] args) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
int N = Integer.parseInt(br.readLine());
for(int i = 0 ; i < N ; i++) {
for(int j = 1; j < N-i ; j++) {
bw.write(" ");
}
for(int j = 0 ; j <= i ; j++) {
bw.write("*");
}
bw.write("\n");
}
br.close();
bw.flush();
bw.close();
}
}
'프로그래밍언어 > 알고리즘' 카테고리의 다른 글
백준 10807 개수 세기_JAVA (0) | 2023.05.05 |
---|---|
백준 10952 A+B-5_JAVA (0) | 2023.05.04 |
백준 2438 별 찍기_JAVA (0) | 2023.05.04 |
백준 11021번 A+B - 7_JAVA (0) | 2023.05.04 |
백준 15552번 빠른 A+B_JAVA (0) | 2023.05.04 |