-
2439: 별 찍기 -2코테/백준 2024. 5. 24. 20:58
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int num = sc.nextInt(); sc.close(); for (int i = 1; i <= num; i++) { for (int j = 1; j <= num - i; j++) { System.out.print(" "); } for (int j = 1; j <= i; j++) { System.out.print("*"); } System.out.println(); } } }
'코테 > 백준' 카테고리의 다른 글
10807번: 개수 세기 (0) 2024.06.03 10951번: A + B (4) (0) 2024.05.29 2438번: 별 찍기 - 1 (0) 2024.05.23 11022번: A + B (8) (0) 2024.05.22 11021번: A + B (7) (0) 2024.05.20