Everything has an expiration date
BAEKJOON - 2439 : 별 찍기 - 2 본문
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
public class Main
{
public static void main(String[] args) throws IOException
{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int countStar = Integer.parseInt(br.readLine());
for (int j = 0; j < countStar; j++)
{
for (int i = countStar - j - 1; i > 0; i--)
{
System.out.print(" ");
}
for (int k = 0; k < countStar-(countStar-j) + 1 ; k++)
{
System.out.print("*");
}
System.out.println();
}
}
}